Dropzone:粘贴(ctrl + v)打印屏幕不起作用

时间:2017-12-28 19:18:49

标签: javascript jquery dropzone.js dropzone

使用Dropzone.js,如果我尝试粘贴(ctrl + v)它不上传的打印屏幕,但是如果我拖动文件则上传有效。有人能帮助我吗?

   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());
           }
       }
   }

0 个答案:

没有答案