I am using the following code for uploading picture from android avd.
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="text/plain";
var filename = imageURI.substr(imageURI.lastIndexOf('/')+1);
var upload_url="http://example.com";
alert(upload_url);
alert(filename);
var params = new Object();
params.value1 = "test";
params.value2 = "param";
options.params = params;
options.chunkedMode = false;
options=null;
var ft = new FileTransfer();
ft.upload(imageURI, upload_url, picUploadSuccess, picUploadFailed,options);
but this code adds few extra header info into the file. like following --* Content-Disposition: form-data; name="value1";
test --* Content-Disposition: form-data; name="value2";
param --* Content-Disposition: form-data; name="file"; filename="1.jpg" Content-Type: image/jpeg
therefore when the file stored into the server, it can not be opened as JPEG Image. I have found that the options object is responsible for adding those extra header info. i tried without the options object by assigning null. but still there are few extra info into the file.
Looking forward for suggestions to upload file without any extra info within the file.