applet file i/o

hi. i'm new to java (coupla weeks), and i want to write an applet that reads adn writes a server-side file. i can do this with an application no problem, but i think it doesn't work with my applet because of security issues.

i have an idea that maybe what i need to do is get the URL of the file, then open a connection to it and use Input/OutputStreams. am i on the right track?

also, to get the URL, can i just give it the name of the file, if the applet resides in the same directory?

any answers/ sample code dealing with URLs and file i/o would be extremely helpful. thanx ~L

[616 byte] By [spoongirl] at [2007-9-26 1:18:52]
# 1

Actually, you need to write a server-side application to do that for you... An applet cannot write to a file on the server (nor on your computer without signing it for that matter). Started to write a program but figured out that I didn't have time... But basically the point is that you can't directly use a URLOutputStream to write to a file... You need to create an application that runs on the computer that holds the file that will accept input and then write to a file.

GN

P.S. I can tell you that I certainly didn't get into this in my first couple weeks :)

statusquo at 2007-6-29 0:50:31 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2

hey thanx for the info! i guess this is more complicated than i realized.

(this may sound too complicated also, but...)

can an applet run another process? for instance, i already have a perlscript that basically does the stuff i want to do. can my applet run the perl script? would this even make sense? (i'm guessing cgi is probably the answer to my problem... but it would have been so cool to use an applet...) :)

spoongirl at 2007-6-29 0:50:31 > top of Java-index,Archived Forums,New To Java Technology Archive...