Ad

Dropzone.js Php Upload Don't Work

- 1 answer

unfortunately my "dropzone" dont work, i followed this tutorial:

http://www.startutorial.com/articles/view/how-to-build-a-file-upload-form-using-dropzonejs-and-php

my ordner structure is the same as mentioned in the tutorial

okay so i have my index.php:

<html>

<head>   

<link rel="stylesheet/less" type="text/css" target="_blank" rel="nofollow noreferrer" href="../css/style.less"/>
<script src="../scripts/less.js"> </script>
<script src="../scripts/dropzone.js"> </script>

</head>

<body>

<!-- 3 -->
<form action="upload.php" class="dropzone">

</form>

</body>

</html>>

upload.php:

<?php
$ds          = DIRECTORY_SEPARATOR;  //1

$storeFolder = 'uploads';   //2

if (!empty($_FILES)) {

    $tempFile = $_FILES['file']['tmp_name'];          //3             

    $targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds;  //4

    $targetFile =  $targetPath. $_FILES['file']['name'];  //5

    move_uploaded_file($tempFile,$targetFile); //6

}
?>  

everything looks good exept theres no file in my uploads folder. I got no erros but im not sure if my error reporting is correct.

Thanks for any help

Ad

Answer

The code above works fine. I got it working after realizing my file was just too big.

Ad
source: stackoverflow.com
Ad