i cant seem to upload image on from cordova using filetransfer to apache server running lamp stack always keep getting http_status : 408 and error code 3 from file transfer im running cordova 3.5 which has file plugin 1.2.0 and filetransfer plugin 0.4.4
here is the code
$scope.transferFile = function (imageURI) {
console.log(imageURI);
//imageURI = imageURI.substr(8, imageURI.length);
//imageURI = 'file://' + imageURI;
//console.log(imageURI);
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
options.chunkedMode = false;
options.headers = {
Connection: "close"
};
// setup parameters
var params = {};
params.fullpath =imageURI;
params.name = options.fileName;
var ft = new FileTransfer();
ft.upload(imageURI, encodeURI('http://www.exoplace.com/uploads/upload.php'), win, fail, options);
}
here is image taking code
var type;
if (t == "gallery") {
type = Camera.PictureSourceType.PHOTOLIBRARY;
} else {
type = Camera.PictureSourceType.CAMERA;
}
navigator.camera.getPicture($scope.transferFile, $scope.uploadFailed, {
quality: 90,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: type,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 500,
targetHeight: 500,
saveToPhotoAlbum: true
});
on server i just keep empty php page called upload.php which returns some random string and does nothing.
the server code is
echo 'test'
any idea is it server or client problem?