Is my code below secure enough to be used in production? <p>What is the best practice to securely upload an image to a php script based on my code below? I'm using the file transfer cordova plugin to upload the image to a php script.</p> <p>Javascript (file transfer cordova plugin)</p> <pre><code>var options = new FileUploadOptions(); options.fileKey = "file"; options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1); options.mimeType = "image/jpeg"; var params = new Object(); params.imageLink = "test"; options.params = params; options.chunkedMode = false; var ft = new FileTransfer(); ft.upload(imageURI, "http://example.com/upload.php", win, fail, options); alert("Post Uploading"); function win(r) { console.log("Code = " + r.responseCode); console.log("Response = " + r.response); console.log("Sent = " + r.bytesSent); alert(r.response); } function fail(error) { $.mobile.loading('hide'); navigator.notification.alert("An error has occurred: Code = " + error.code, null, 'Alert', 'OK'); } </code></pre> <p>PHP</p> <pre><code>&lt;?php if(isset($_POST['imageLink'])) { $imageLink = $_POST['imageLink']; print_r($_FILES); $new_image_name = $imageLink.".jpg"; move_uploaded_file($_FILES["file"]["tmp_name"], “uploads/“.$new_image_name); } ?&gt; </code></pre> <p>Any suggestions?</p>