Coding

Open Source Drag & Drop Upload Java Applet for Websites

Screenshot Java Upload WidgetWith traditional HTML 4, file upload through a website is a cumbersome process, especially if you want to upload a large number of files. The recent surge of AJAX technologies has made web pages behave more like normal desktop applications, but it hasn’t been able to overcome the limitations of HTML4 since the ability of JavaScript to access the filesystem remains limited to using the INPUT tag in some form.

The most intuitive form of moving files from one location to another is to drag & drop them from a file sytem explorer window to the desired target.This is not possible on a webpage using JavaScript since JS cannot intercept such drops. Instead, the browser will open the dropped file.The only way to accomplish both intercepting a drop and to upload the dropped file to a remote server is to use an Flash or Java Applet.Since I know nothing of Flash, but a bit of Java, I did a search for Java Applets which could accomplish the task – thinking that there must be tons of such applets. Surprisingly, I didn’t find any that were both open source and ready-to-use.

Instead, there were many closed-sourced applets with restrictive and expensive licenses, and a few sites which offered code snippets. So I decided to try my luck and build on the code I found.
Continue reading