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