Multiple-target cross-browser drag& drop file uplo

2019-07-22 14:08发布

问题:

We're investigating if it's possible to have the following: A webpage with multiple 'folders' to which a user can drag & drop a files. It's meant to be used as an interface to upload scanned documents to an archive.

For example, we would have page that states: 'Quotes', 'Invoices' & 'Misc'. Depending on the sort of document the user would drag & drop the file from the local file system to one of these three folders. It should then upload the file to the correct folder on the web server.

Is this possible, and if it is, any existing solutions using ASP.NET?

回答1:

You can use modern browsers HTML5 functionalities to do so. A detailed explanation here: http://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/ There is also the jQuery plugin: https://github.com/weixiyen/jquery-filedrop This one is a bit bogus (truncates files with accents like in french, doesn't handle correctly several drop areas in the same page, ...), but are easy to fix (I sent a fixed version to the author weeks ago, but didn't get any feedback...) With some Ajax and the correct server-side solution, it works like a charm. I don't know any .NET solution, though. Best,



回答2:

You could use a silverlight app or a java applet, but those are the only solutions that I know of... The users would obviously need to have silverlight or the jre installed.