forked from dropzone/dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
Make the whole body a dropzone
enyo edited this page Apr 6, 2013
·
2 revisions
If you want the whole page to be droppable, still want a button to select files and a container where to display the file previews, this is the way to do it:
<!doctype html>
<link rel="stylesheet" href="dropzone.css" />
<script src="dropzone.js"></script>
<!--
Don't forget to give this container the dropzone-previews class
so the previews are formatted correctly.
-->
<div id="previews" class="dropzone-previews"></div>
<button id="clickable">Click me to select files</button>
<script>
new Dropzone(document.body, { // Make the whole body a dropzone
url: "/upload/url", // Set the url
previewsContainer: "#previews", // Define the container to display the previews
clickable: "#clickable" // Define the element that should be used as click trigger to select files.
});
</script>For a live example, please visit this url: http://www.dropzonejs.com/demos/full-page-dropzone.html
- Dropzone already attached
- Large files not uploading
- Some image thumbnails aren't generated
- Show error returned by server
- Notification when all files finished uploading
- Add button to remove file preview
- Submit additional data
- Show info after file uploaded
- Show files already on server
- Use own
confirmimplementation - Limit the number of files
- Provide a thumbnail for files
- Reject images based on dimensions
Tutorials