I have a picture upload form powered with dropzone.js (http://www.dropzonejs.com/):
<form action="<?php bloginfo('template_url'); ?>/frameworks/dropzone/upload.php" class="dropzone" style="margin: 100px; border:solid; "></form>
This works fine! But the upload.php file won't properly upload my images...
$ds = DIRECTORY_SEPARATOR; //1
$storeFolder = "uploads"; //2
echo "√ Launched upload.php";
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name']; //3
$targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds; //4
$targetFile = $targetPath. $_FILES['file']['name']; //5
echo "<br>Target Path: ".$targetPath;
echo "<br>Target File: ".$targetFile;
move_uploaded_file($tempFile,$targetFile); //6
echo "<br>√ move_uploaded_file";
}
The move_upload_file doesn't seem to work properly...... Any hints?
Errors: Warning: move_uploaded_file(/var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/frameworks/dropzone/uploads/kimono's at JTC.jpeg): failed to open stream: Permission denied in /var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/frameworks/dropzone/upload.php on line 25 Warning: move_uploaded_file(): Unable to move '/tmp/phpDXnFKq' to '/var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/frameworks/dropzone/uploads/kimono's at JTC.jpeg' in /var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/frameworks/dropzone/upload.php on line 25