Cordova File Transfer entfernen Multipart- oder Content-Disposition-Header
Ich konnte mit dem Cordova File Transfer-Plugin ein Bild auf meinen Server hochladen.
var img = <full path to image>
var url = <url to webservice>
var options = new FileUploadOptions(); //no specified options, using defaults
var ft = new FileTransfer();
ft.upload(img, encodeURI(url), win, fail, options);
var win = function (r) {
console.log('Successfully sent');
}
var fail = function (error) {
console.log("An error has occurred: Code = " + error.code);
};
Mein Server hatte jedoch aufgrund des vom Plugin hinzugefügten zusätzlichen Headers Probleme, das Bild zu lesen.
--+++++..Content-Disposition: form-data; name="file"; filename="filename.jpg"..Content-Type: image/jpeg....