Skip to content Skip to sidebar Skip to footer

How Can I Let Users Upload Files By Copy/paste?

I'm trying to create a web app based on ExtJS, and I'm working on the file-upload area of the app. I want users to be able to upload files by copying and pasting them - not just c

Solution 1:

The thing is, that you're not able to access the clients filesystem with javascript. There is this new Filesystem API, but this just allows you to create a virtual sandboxed filesystem. I had the same problem, thought about it a while and came up with the following ideas.

  1. Flash

    Writing a Flash bridge which access the filesystem and let the javascript communicate with it via swliveconnect

    Problem: Flash doesn't have filesystem access either.

  2. Java applet

    Same thing as Flash and again with LiveConnect

    In my opinion this could work, but I didn't try it out, because my goal was to get filesystem access on a chromebook. And chromeOS doesn't support Java (at least without some hacking)

  3. ActiveX

    I also found some solutions with this. I gave up at the applet part so I didn't try this out either.

As Jared Farrish said, when you copy a file the os just saves the path to the file in the clipboard. Then if you receive the paste event on your webapp just get the string out of the clipboard and forward it to your file bridge.

Solution 2:

I've seen that DropBox.com allows this to be done (in chrome- didn't seem to work in IE). I didn't do cut and paste specifically, but dragged files into a dropbox page from a local folder, and it uploaded the files. So, this doesnt directly answer your quesiton, but perhaps you can look at how this is done in their code.

Post a Comment for "How Can I Let Users Upload Files By Copy/paste?"