• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

applets and open file dialog

 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic