Trying to have an applet write to a file on the same machine !_NEWLINE_!in which the applet resides.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, March 22, 2001 03:21 PM

I am trying to have an applet write to a file that exists on the same system in which the applet resides. I am not trying to write to a file on the local machine. I know applets can't do that. I thought restrictions were relaxed when the applet is from the same machine. To be crystal clear: Let's say I run my browser from a machine called "my_pc". The applet (the actual .class file) lives on a machine called "the_server". I want the applet to write to a file called "foo" which resides on "the_server". Also, if I was to do a getCodebase().getHost() in the applet, it would return "the_server". NOW... I am able to read from the file &   More>>

I am trying to have an applet write to a file that exists on the same
system in which the applet resides. I am not trying to write to a file
on the local machine. I know applets can't do that. I thought
restrictions were relaxed when the applet is from the same machine.
To be crystal clear: Let's say I run my browser from a machine called
"my_pc". The applet (the actual .class file) lives on a machine called
"the_server". I want the applet to write to a file called "foo" which
resides on "the_server". Also, if I was to do a getCodebase().getHost()
in the applet, it would return "the_server". NOW... I am able to read
from the file "foo" but I can't write to it. I open a URL connection and
a PrintStream. I get no exception messages in the JAVA console. By
looking at the JAVA console, it looks like everything's fine but when I
look at the file "foo" on "the_server", it hasn't been written to. I have
an html file that calls the applet. Like I said, the applet reads the file, "foo"
with no problem. It just doesn't write to it. Am I missing something or
is this just not possible? Also, if it isn't possible why don't I get any
exceptions in the JAVA console? (I certainly get an exception if I try
to write to a local file(a file living on "my_pc")) If it's some kind of
permission problem, why don't I get an exception when I try to open
a PrintStream? Thanks for any help.

   <<Less

Re: Trying to have an applet write to a file on the same machine !_NEWLINE_!in which the applet resides.

Posted By:   John_Zukowski  
Posted On:   Friday, March 23, 2001 07:02 AM

As already described in the FAQs, URLs don't support this. You need something listening on the server to write to the file.
About | Sitemap | Contact