File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes reading file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "reading file" Watch "reading file" New topic

reading file

bahareh mahdavi

Joined: Nov 14, 2004
Posts: 1
I need to read a text file from applet but when I do this my applet do not start or init. My browser is Internet Expoler 5 please help me.
Joe Ess

Joined: Oct 29, 2001
Posts: 9191

The Java Tutorial: Writing Applets: Security Restrictions

An applet cannot ordinarily read or write files on the host that is executing it.
The JDK Applet Viewer actually permits some user-specified exceptions to this rule, but Netscape Navigator 2.0, for example, does not. Applets in any applet viewer can read files specified with full URLs, instead of by a filename. A workaround for not being to write files is to have the applet forward data to an application on the host the applet came from. This application can write the data files on its own host. See Working with a Server-Side Application for more examples.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: reading file
It's not a secret anymore!