粘贴(ctrl + v)图像文件上传器

raj*_*raj 1 jquery

粘贴图像后,我们需要调用图像文件上传.我需要针对以下问题提供解决方案.粘贴特定div中的图像后,我们如何将粘贴图像作为文件对象?

我正在使用jquery.filedrop.js来完成"拖放"并浏览按钮图像文件上传.但我无法做ctrl v图像文件上传.

拖放图像后,我们可以使用fllowing代码"files = e.dataTransfer.files;"将图像作为文件删除.

但是在粘贴(ctrl + v)中,我们无法以这种方式获得.

请建议我们如何进行粘贴(ctrl + v)文件上传.

我们使用以下链接中的jquery.filedrop.js:

http://www.github.com/weixiyen/jquery-filedrop

Tom*_*Tom 5

您可以使用jquery的热键插件来捕获keyup上的ctrl + v事件,如下所示:

$(document).bind('keyup', 'Ctrl+v',function (evt){
    evt.preventDefault();
    call_uploader_here
});
Run Code Online (Sandbox Code Playgroud)