android : image upload using multipartentity -
i'm trying upload image on php server using multipartentity, have used httpmime 4.3 jar import multipartentity, have added jar app, can't import class.
public void postpicture(string path, file file) throws parseexception, ioexception { httpclient httpclient = new defaulthttpclient(); httpclient.getparams().setparameter( coreprotocolpnames.protocol_version, httpversion.http_1_1); httppost httppost = new httppost(path); multipartentity mpentity = new multipartentity(); filebody cbfile = new filebody(file, "image/png"); cbfile.getmediatype(); mpentity.addpart("userfile", cbfile); httppost.setentity(mpentity); httpresponse response = httpclient.execute(httppost); }
can me. in advance.
Comments
Post a Comment