Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="" rel="stylesheet">
<div class="h-64 border-solid border-black border-4 text-center" id="dropzone">
Drop files here
<form action="test.php" enctype="multipart/form-data" method="post">
<input type="file" name="files[]" id="files" multiple>
<button type="submit">Send</button>
<script src=""></script>
var $dropzone = $('#dropzone');
$dropzone.on('drag dragstart dragend dragover dragenter dragleave drop', function (event) {
}).on('drop', function(event) {
document.querySelector('#files').files = event.originalEvent.dataTransfer.files;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment