Hello, I have the following code
onDeviceReady: function () {
navigator.camera.getPicture(
app.uploadPhoto,
function (message) { alert('get picture failed'); },
{
quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
}
);
},
uploadPhoto: function(imageURI) {
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
var params = {};
params.value1 = "test";
params.value2 = "param";
options.params = params;
var ft = new FileTransfer();
ft.upload(imageURI, encodeURI("http://192.168.0.101/upload/index.php"), app.win, app.fail, options);
},
win: function(r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
},
fail: function(error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
},
It's working, but when I upload to my php I do not know how to save, my php looks like this:
<?php
move_uploaded_file($_FILES["file"]["tmp_name"], 'C:\xampp\htdocs\upload\images');
?>
I would like to save within C:\xampp\htdocs\upload\images
, how should my php be?