• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading a file from applet using webapplication....

 
madhu Chitloore
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am creating a file using an applet ... that applet code is above web-inf folder .... if i create a file ... its creating on my desktop instead of current directory where applet is running .... what is that so?
and also i have two files where i am reading from applet ... but if i place those two files in my desktop , then it reads ... and if i place those files in current directory i will get FileNotFoundException.
I have created my own .java.policy file for accessing and reading the files...i have no problem in that....
The problem i am facing is , when i give absolute path , the file is being read ... but my question is why always c:\Document and Settings\madhu\Desktop ?? why it takes this as a classpath ??

Thankyou,
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use the classes in the java.io package, then you'll always be dealing with local files. The Desktop is probably the default directory.

If you want to read a file that's on the server then you can't use those classes. Have a look at the HelloServerFile applet at http://faq.javaranch.com/java/CodeBarnApplets - it shows how to do that.
 
madhu Chitloore
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much .....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic