Dropzone is a jQuery plugin for a simple drag and drop file uploader. It allows you to drag and drop any file into the dropzone, you can click on the dropzone and simply select the files you wish to upload.
Demo at: http://jsbin.com/wamekuj/4/edit?js,output
<div class="dropzone"></div>
<script type="text/javascript">
$(".dropzone").dropzone({
url: 'upload.php' //required filed
})
</script>
width
- width of the dropzoneheight
- height of the dropzoneprogressBarWidth
- width of the progress barurl
- link to the file you wish to send the filesfilesName
- name of the input[file] name //<input type="file" name="{filesName}"margin
- margin added if neededborder
- border propertybackground
- background propertytextColor
- color propertytextAlign
- text-align propertytext
- text inside the divuploadMode
- upload all files at once or upload single files, options: all or singleprogressContainer
- progress selector if null one will be createddropzoneWraper
- wrap the dropzone div with custom classfiles
- access to the files that are dropedmaxFileSize
- max file size ['bytes', 'KB', 'MB', 'GB', 'TB'], 100MB defaultallowedFileTypes
- allowed files to be uploaded seperated by ',' jpg,png,gifclickToUpload
- click on dropzone to select files old wayshowTimer
- show timer for each upload progress to time the uploadremoveComplete
- removes complete progresssed //default: truepreview
- Shows the current image on the dropzone, no uploadparams
- extra paramenters for uploading
load
- fires when the div is created, returns thisprogress
- fires when the files are being uploaded and returns the prcent and the index of the fileuploadDone
- fires when all files have been uploadedsuccess
- fires when a single files is uploaded and get the response back, then the index of the progresserror
- fires when there is a error in the uploadpreviewDone
- fires when the preview imagesis rendered
-updateParams
$('.dropzone').dropzone('updateParams', {action: 'newAction'});
Copyright © Marko Kuhar