Question

I need an applet for drag drop upload, and have found quite a many file upload applets on web. But i have some different requirement i want an image which is clipboard to be uploaded on paste or drag.

for eg: say i have an image in an excel sheet and i want to upload it without saving the image to an image file but rather directly copy paste or drag it to applet

Is it feasible? if yes please help me in achieving the same. I am using java for obvious reasons

EDIT : it seems drag drop wont be feasible so can we copy paste an image? in applet

Was it helpful?

Solution

For a trusted applet, access the Clipboard in the same way as you might with an application. In fact, I'd check the details of pasting images in a frame before bothering to attempt it in an applet.

For a sand-boxed applet deployed in a Plug-In 2 JRE1, it is possible to deploy the applet using Java Web Start and use the services of the JNLP API's ClipboardService to enable paste functionality. Here is a (application based) demo. of the ClipboardService.


Uploading the image to the same server that hosts the applet can be done by a trusted or sand-boxed applet. A trusted applet can upload to whatever server will accept a connection from it.

You might implement the server-side of the upload using servlets or PHP ..whatever you'd use for the other upload applets (or Flash etc.).


  1. Chase the links in the applet info. page for more information on the Plug-In 2 JRE architecture and what it provides for applets.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top