java(script) filter help me please!
July 5, 2007 8:28 AM
Subscribe
Javafilter: Can a Java Applet that runs on my website save and edit files on my website?
Basically what I need to do is have a javascript app call out a java program with some variables as arguments, then the java applet would save them to a file on my website.
I'd also like to use a java applet to read said file from my website and convey certain variable to the javascript program for display in the webpage.
Do I need to set certain read/write permissions for the java applet?
posted by spacefire to computers & internet (8 comments total)
1 user marked this as a favorite
However, its not typical that an applet running in the client browser has the ability to use the normal java.io.File/java.io.FileInputStream/java.io.FileOutputStream classes to read/write files to the server computer from where it came from. Typical ways this would be done would be Web-DAV or the relatively new Atom Publishing Protocol.
A more common way that this is accomplished is that the Java applet uses HTTP to request the file in question and then when it is time to save the file back to the server, the applet uses HTTP to POST the data to code running on the web server. This could be anything from a Java Servlet to a CGI program to Ruby/Perl/Python/etc. your pick.
As long as your applet is strickly interacting with only the server that it was downloaded from the default permission model should be fine for you.
posted by mmascolino at 8:37 AM on July 5, 2007