Upload file to HTML5 page using keyboard shortcuts

I know that you can upload files using drag and drop using the HTML5 file APIs. Can this also be done by copying the file from the file explorer and pasting it onto the web page using CTRL-V / CMD-V or pasting the right button from the context menu?

+5
source share
1 answer

You cannot do this.

You can easily get the file path as follows:

$(document).on('paste',function(e){
    var path = e.originalEvent.clipboardData.getData("text");
});​

So, you can show it to the user.

But you cannot change your meaning <input type=file>.

: , script , , ( , )? , " ".

+1

All Articles