Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Drag and Drop files from local files sytem to applet.

 
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.
 
Saloon Keeper
Posts: 22122
151
Android Eclipse IDE Tomcat Server Redhat Java 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 ]
 
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: 22122
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic