• Post Reply Bookmark Topic Watch Topic
  • New Topic

can an applet read/write a file on the host instead of local system?  RSS feed

 
Wenzhong Hu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greeting,

My question is this: I need write an applet that have to access a file on the host server instead of local system. For example, if the applet is downloaded from www.xxx.com/lab4 , then that file also is in www.xxx.com/lab4. How can the applet connect back to its home directory to access that file?

Thanks a million!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the file is in the same directory as the applet, and thus publicly accessible, you can use the HttpURLConnection class to retrieve it.
[ July 24, 2005: Message edited by: Ulf Dittmer ]
 
Alan apz
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lab4 rock
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24216
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Ulf says, reading the file is easy. To write to the file, you'll generally need a servlet or other server-side program to receive the data and write it to a file.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!