Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applets and open file dialog

 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. if anybody has a minute, this has been kinda on my mind for a while but i've been preoccupied and i'm kinda revisiting it. The only way I've implemented an open file dialog in any kinda j2ee or lightweight java platform (like Domino) is to use swing, JFileChooser, and a signed applet. However, I've always wondered how, for instance, hotmail or yahoo mail "get away" with open file dialogs (and subsequently os access) sans trust signer prompts or security warnings. Is there a java alternative outside of signed applets? I remember looking around a while ago but finding pretty much nothing. Thank you very much for reading this.
[ August 31, 2007: Message edited by: Tom Griffith ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those web applications do not really have access to the file system. All they do is cause the dialog box to be opened by the browser. JavaScript (the client-side language behind those web apps) does not have any file I/O capabilities, and thus can't manipulate disk contents.

Java, on the other hand, can read and write files, and thus needs to be fenced into the JVM sandbox before it is allowed to do anything with the file system.

Does this make things clearer?
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf. Since javascript doesn't have os access, it must call some kinda script or something that performs the i/o upload to the mail message, right?
[ September 04, 2007: Message edited by: Tom Griffith ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite. It's the browser itself that opens a file dialog if a form is rendered that contains a FILE field, and then the Browse button is clicked. No other script or code is involved.
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok..i'll look into javascript more but then somehow the browser internally streams the selected file to the FILE field? is that right?...

in the end, i guess none of this would be of any help as far as, say, streaming selected content to a server or web service...
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
somehow the browser internally streams the selected file to the FILE field?

When the form is submitted, the browser sends the file contents along with the other form parameters to the server, yes.

streaming selected content to a server or web service

If by selected you mean "selected parts of a file", then no, that's not possible. If by selected you mean "contents of a selected file", then yes, that's exactly what it does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic