0

I will be using the following Android Java code to upload an image to C# server API:

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(FILE_UPLOAD_URL);
AndroidMultiPartEntity entity = new AndroidMultiPartEntity();

File sourceFile = new File(filePath);

// Adding file data to http body
entity.addPart("image", new FileBody(sourceFile));
     
totalSize = entity.getContentLength();
httppost.setEntity(entity);
     
// Making server call
HttpResponse response = httpclient.execute(httppost);
HttpEntity r_entity = response.getEntity();

What would be the equivalent code from C# side API to receive this image?

Yomash
  • 25
  • 4
  • I am still putting up the code from the app side, but before I implement uploading the image I wanted to do some R&D on the receiving end as I am not strong in C#, I wanted to actually check if I will be able to develop it... Short answer: didn't try anything yet, just doing R&D to see if there is something already available on the net. – Yomash Feb 03 '16 at 05:19
  • 1
    This might help: http://stackoverflow.com/questions/10320232/how-to-accept-a-file-post-asp-net-mvc-4-webapi – Sumner Evans Feb 03 '16 at 05:21

0 Answers0