Nicolas Hernandez created CB-11894:
--------------------------------------
Summary: Filetransfer not upload image
Key: CB-11894
URL: https://issues.apache.org/jira/browse/CB-11894
Project: Apache Cordova
Issue Type: Bug
Components: Plugin Camera, Plugin File Transfer
Affects Versions: 6.3.1
Reporter: Nicolas Hernandez
I'm trying to send an image to my server. My service on my server is made in c
#, Formerly used from an input file type for the image. Now I'm working the
mobile version of this function. Working with the file transfer and camera
plugin. When I try to upload the image either from taking a picture or select
it from my library on the phone fails, but do not receive error receipt that
the increase was correct, the file is saved on my server but black. The image
can not be opened, however, from my application and from an input file type is
uploaded correctly. This is me on Android and iOS.
function win(r) {
console.log(r);
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
}
function fail(error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}
imageURI = $scope.photo;
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
options.mimeType = "image/jpeg";
var params = new Object();
options.params = params;
options.chunkedMode = false;
var ft = new FileTransfer();
ft.upload(imageURI, UrlUpdateFile.url + "/" +
imageURI.substr(imageURI.lastIndexOf('/') + 1), win, fail,
options);
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]