• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can applet read form a file on host machine

 
Jigar Gosar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by host m/c i mean from the m/c on which applet code is located.
please give me some example.
thanks in advance
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in the sense of "open file", "read data", "close file". First the host would not only have to be a web server, but a LAN server, but even then, the Java sandbox restricts unsigned applets from doing file I/O.
However, an applet CAN make a web server request using HttpURLConnection to the host from which it was loaded, and the web server can send back any sort of data it wants, including data from any files that it can read.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jigar,
Reading and writing files are outside the Applet sandbox. In most cases you will need to sign your applet to make it trusted. Click on this link to get some information:
http://java.sun.com/sfaq/
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic