I'm stucked with this for the whole day, the JavaScipt code seems fine. But in the output i get this:
2012-09-25 15:09:57.584 ViviJesolo[13863:c07] File Transfer Finished with response code 200
2012-09-25 15:09:57.586 ViviJesolo[13863:c07] [INFO] Code = 200
2012-09-25 15:09:57.586 ViviJesolo[13863:c07] [INFO] Response = Array%0A(%0A%20%20%20%20%5Bfile%5D%20=%3E%20Array%0A%20%20%20%20%20%20%20%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Bname%5D%20=%3E%20cdv_photo_027.jpg%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Btype%5D%20=%3E%20image/jpg%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Btmp_name%5D%20=%3E%20/tmp/php4i7HAa%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Berror%5D%20=%3E%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Bsize%5D%20=%3E%202340%0A%20%20%20%20%20%20%20%20)%0A%0A)%0A
2012-09-25 15:09:57.587 ViviJesolo[13863:c07] [INFO] Sent = 2548
My server side script is:
<?php
print_r($_FILES);
$new_image_name = "namethisimage.jpg";
move_uploaded_file($_FILES["file"]["tmp_name"], "/httpdocs/upload/".$new_image_name);
?>
I've checked the permissions and it's ok, but i can't see the uploaded file. What could be the problem?
Edit: I'm uploading the image using FileTransfer object like this:
function uploadPhoto(imageURI)
{
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpg";
var params = new Object();
params.headers={'headerParam':'headerValue'};
options.params = params;
options.chunkedMode = false;
var ft = new FileTransfer();
ft.upload(imageURI, "site.com/upload.php";, win, fail, options);
}