2

Using Dropzone.js, if I attempt to paste (ctrl+v) a printscreen it does not upload, however if I drag a file the upload works. Can someone help me?

   Dropzone.autoDiscover = false;


   var dropzone = new Dropzone("form.dropzone", {
       dictDefaultMessage: "Arraste uma imagem ou clique aqui"
   });


   document.onpaste = function(event){
       var items = (event.clipboardData || event.originalEvent.clipboardData).items;
       for (index in items) {
           var item = items[index];
           if (item.kind === 'file') {
               // adds the file to your dropzone instance
               dropzone.addFile(item.getAsFile());
           }
       }
   }
Kalnode
  • 9,386
  • 3
  • 34
  • 62
Rene
  • 145
  • 1
  • 11
  • big up for this question. I'm looking to have the same functionality in my angular 5 project. I like that feeding paste can be captured and fed to the dropzone. I notice you asked this 2 months ago. have you found a solution by yourself? – tatsu Mar 14 '18 at 13:09
  • link: https://stackoverflow.com/questions/32493709/enable-copy-and-paste-files-in-dropzone-js –  Apr 01 '19 at 22:59

0 Answers0