views:

146

answers:

2

Sometime ago I was facing the problem the other way around: how to drag an item (folder/file) from an explorer window (be it windows explorer, linux nautilus etc.) to the browser window - that is, the drag starts in one application and ends in the browser. Since I had control over the browser, I was able to intercept the dragend event: the one which interested me.

Now, I want to do this from the browser to the file explorer application: much like when you drag an image from firefox and drop it in a folder.

My main problem is that while I can check when the drag event exited the browser window, I have no ideea how to get the location where the drag event finished.

My ideea is to create a signed java applet and somehow track the mouse movement on the desktop - but this seems a little more than overkill.

Any pointers on this?

+1  A: 

You won't be able to do this with JavaScript. JS is sandboxed in the browser and can't interact with anything outside.

deceze
That I know. I am going to use JS only to detect the dragexit event from the html document, and pass control to the java signed applet. At least, that's the idea at this time.
ivb
+1  A: 

According to your justification is is not simple, but it can be managed. There is class called DataFlavor. You had to use D&D mechanism introduce in java using Transferable objects and provide correct mime-types and corresponding conversion. The problem is which mime-type will be accepted by explorer. I hope this help.

Rastislav Komara
I guess it will accept most of the main mime-types. I believe now that when the dragexit happens, I need to pass control over to the java applet and from there construct the Transferable objects.
ivb