Do a test to upload and submit data, encountered a problem, if only the string type parameters, the server side to accept the parameter is not a problem, if the file type, the server-side servlet accepts the parameters are empty.
The code is as follows
Finalhttp fh = new Finalhttp ();
Ajaxparams params = new Ajaxparams ();
Params.put ("Action", "Test");
Params.put ("username", "aaaaa");
try {
Params.put ("File", New file ("/mnt/sdcard/1.jpg"));
} catch (FileNotFoundException e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
Fh.post (Serverurl,params, New ajaxcallback<object> () {
@Override
public void onloading (long count, long current) {
Super.onloading (count, current);
}
@Override
public void onsuccess (Object t) {
TODO auto-generated Method Stub
Logger.info ("return message is +" + t.tostring ());
}
});
Afinal Upload file service side accept parameter is empty