Android Image upload to C# .NET REST service -


i know question has been asked lot on stackoverflow , on internet, seems there never common or best solution upload image multi-platform .net rest service.

i have found solution question asked before here service side, first question is, best , optimized way upload image android specific service specified in link ?

my second question is, how can add json data accompany image being uploaded? have seen solutions of appending data in header param , not json? perfect way ?

i have few proposals while uploading file web service:

  1. write web serivice allow multi part file upload using multipartformdatastreamprovider
  2. dont read whole file content while uploading web service. rather use httpclient library upload mutiple part content. see multipartentity.

    httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("service url"); filebody body1 = new filebody(new file(path), mimetype); multipartentity reqentity = new multipartentity(); reqentity.addpart("part0", body1); httppost.setentity(reqentity);       
  3. use android background service when uploading file. if big file take long time upload. if app went backgournd upload process might internupted.

  4. in server side need custom implementation of multipartfilestreamprovider class pass additional file attributes.

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -