• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drag and Drop files from local files sytem to applet.

 
Herbert Kornfeld
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am wondering if I will be able to drag and drop files on a local filesystem into a JList in an applet in the browser. I know I will have to use a signed applet and whatever else. I will have just a finite number of known users for this application so if I have to ask them to do something special that is OK. I am using MAC OS10.
Thanks a lot.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, this just might be something you can do without having to sign the applet. The bigger question is "Can the standard Java DND subsystem drag and drop file objects from the desktop?".
I'd take a look at the docs on that one.
The reason I say you might not have to sign the applet is that the sandbox is designed to prevent Bad Things from being done to the client by code coming from the host. With DND, what you're actually doing is having a user drag a known object into the awareness of the applet. The object being dragged isn't the file itself, it's something that can be queried to get the name/path of the file (of course opening the file will require a signed applet). So what DND is doing is really no different in net effect than entering the filename in as though you'd typed it in. Only without the typing.
[ April 17, 2003: Message edited by: Tim Holloway ]
 
Manoj Pooleery
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from getting the file name, is it possible to access the physical file? Like read from it? Also, if I know that it is from a trusted site, can the signing be avoided by setting the browser/JRE properties?
Thanks
-Manoj.
[ May 10, 2003: Message edited by: Manoj Pooleery ]
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To read or write a file always requires that the applet be given permissions and signed.
Sun doesn't consider a server as "trustworthy" so applets don't get special benefits just because they came through a trusted pipe. Though even paranoia has its limits, which is why an unsigned applet is allowed to talk back to the server it came from. Even if that server isn't "trustworthy".
I think that comes under the heading of any machine (e.g. the server) that's already corrupt doesn't rate protection. But even a corrupt server can't supply code that can corrupt the client unless the client is willing to accept the corrupt server's signature.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic