In my android application I want send request to the server and upload the photo. Here is my code
function uploadPhoto(imageURI) {
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
var params = new Object();
params.value1 = "test";
params.value2 = "param";
options.params = params;
options.chunkedMode = false;
var ft = new FileTransfer();
ft.upload(imageURI, "http://192.168.1.4:3000/api/upload/", win, fail, options);
}
I want also set value on header. For more clearly I want set some codes about it, it is done by Jquery Ajax. I want do similarly on FileTransfer.
$.ajax({
type: "POST",
beforeSend: function (jqXHR) {
jqXHR.setRequestHeader(KEY1, _key1);
jqXHR.setRequestHeader(KEY2, _key2);
}
i am wondering could I set some values on header using FileTransfer()?
Support for setting headers in FileTransfer will be included in the 1.9 release. Expect this to be out near the end of June.