2

im using asynchttpclient in android to upload an image as (Byte array) to the server

byte[] bytes;  //incommming bytes


RequestParams params = new RequestParams();
        params.put("imgBytes",new ByteArrayInputStream(bytes));

        ServerConnection.get("saveImage", params, new TextHttpResponseHandler() {
            @Override
            public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
                Log.d(TAG, "uploadByteArrayPhoto: onFailure: uploading failed "+responseString +" throwable :  "+throwable.getMessage() );
            }

            @Override
            public void onSuccess(int statusCode, Header[] headers, String responseString) {

                Log.d(TAG, "uploadByteArrayPhoto: onSuccess: uploading success "+responseString);
            }
        });

So my question is how do i handle this in the server side (asp.net MVC C#),

I need a function in the MVC controller to handel this ByteArrayInputStream and coverting it to an image file (PNG/JPEJ) then save it in the server , So ,i can store the image url in the SQL

Tarik Husin
  • 197
  • 2
  • 9

0 Answers0