Reading files from clipboard in javascript

In chrome, when I insert files into text areas, I end the path, for example /home/antimatter15/sha1.js . The insert event includes a .clipboardData object with things such as the standard getData / setData methods. There are also .files , but the length is always 0 . Is there a way to get the attached file, possibly with FileReader , like how files can be dragged and dropped.

+4
source share
1 answer

I was looking for something similar a while ago, and as far as I know, this is not possible using just JavaScript and html (at least not in any reliable way). Firefox and IE 9 seem to offer some support for reading local files, but for the vast majority of visitors to a public site, you will need a Flash, Java, or ActiveX control to access the buffer.

We searched for this functionality for a support service application and installed an inexpensive ActiveX control called xStandard. Thus, I never tested Java to comment on this part of your question. Hope someone else can develop this approach.

Can you provide additional information about your user base, and if running OS and browsers?

+1
source

All Articles