JavaScript / AJAX file upload

# add this code snipset to your homepage and customize path to upload.php
<img src="" id="dropzone" title="Upload">
<script src=""></script>
<script type="text/javascript">
var myDropzone = new Dropzone("#dropzone", {url: "upload.php"});
myDropzone.on("success", function(file) {
# create upload.php on your webserver
$DIR = "upload";
if(!empty($_FILES)) {
    // move file to upload directory
    move_uploaded_file($_FILES['file']['tmp_name'], $DIR . "/" . $_FILES['file']['name']);
# OPTIONAL: create .htaccess to alow php file execution in a specific directory
<FilesMatch "\.(php)$">
SetHandler application/x-httpd-php
# Links - c't  Uploader 2.0, Mehrere Dateien parallel auf die eigene Website hochladen - Download c't  Uploader 2.0