devmobilenid / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Not able to post image using HTTP POST multipart. #176

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am not able to post an Image to my server. I tried with postman(chrome 
extension) its working on it.

here's my code

AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.weakHandler(this, "callback");
cb.type(JSONObject.class);
cb.url(apiUrl);     
cb.header("auth", header);

Map<String, Object> params = new HashMap<String, Object>();

filePath = "/storage/sdcard0/IMG_136289526505467.jpeg";
File file = new File(filePath);
AQuery aq = new AQuery(this);
aq.id(R.id.imageView).image(file, 400);

params.put("image_file", file);
params.put("title", "title of the screen");
cb.params(params);

aquery.ajax(cb);

What version of the product are you using? On what operating system?
0.26.7

Am I missing something ?

Original issue reported on code.google.com by nishant....@raweng.com on 24 Feb 2014 at 7:04