c# - Handle post (from iOS) with image in asp.net server -


first, question briefly: should write in action parameters handling image sent , how handle data image of it?

what did is:

  1. image in ios converted nsdata (which byte array data if i'm not wrong.

  2. using afnetworking post: strings need in params dict , image data in [formdata appendwith...].

on server side, how should action like? it's:

    public jsonresult handledata (string x, string y, ???????????) {} 

the strings come parameters dictionary need image data , reverse real image?

thank in advance!

so.. solution simple use in httppostedfilebase.

just added parameter method (httppostedfilebase file) , then:

if (file.contentlength > 0)             {                 var filename = path.getfilename(file.filename);                 var path = path.combine(server.mappath("~/content/images"), filename);                 file.saveas(path);             } 

hope useful poeple me drowning in more complex solution out there...


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -