I'm trying to send a picture, taken in my application, to my remote server using javascript and php, but so far I'm stuck:
This is the code from my application
function onPhotoDataSuccess(imageData) {
alert(imageData);// returns:"/CapturedImagesCache/WP_20130605_021.jpg"
//send picture to server
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageData.substr(imageData.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
var params = new Object();
params.value1 = "test";
params.value2 = "param";
options.params = params;
var ft = new FileTransfer();
ft.upload(imageData, "http://***.**/app/upload/upload.php", win, fail, options);
alert ("picture will be send");
}
The PHP server is running:
$new_image_name = "YEAH.jpg";
move_uploaded_file($_FILES["file"]["tmp_name"],"/httpdocs/app/upload/images/".$new_image_name);
And this is the error I'm getting:
Log:"Error in error callback: FileTransfer1933815797 = ReferenceError: Invalid left-hand side in assignment"
I really hope anyone has any experience with this, as this is for a school project which is due in 2 weeks.