You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
Falieson edited this page Nov 26, 2015
·
3 revisions
Install the raix:ui-dropped-event package. It adds the dropped event to the Meteor templates.
Note the FS.Utility.eachFile utility function - it supports files from both <input> and dropped files.
Template
<divid="dropzone" class="dropzone"><divstyle="text-align: center; color: gray;">Drop file to upload</div></div>
Javascript
Template.hello.events({// Catch the dropped event'dropped #dropzone': function(event,temp){console.log('files dropped');FS.Utility.eachFile(event,function(file){Images.insert(file,function(err,fileObj){//If !err, we have inserted new doc with ID fileObj._id, and//kicked off the data upload using HTTP});});}});