Skip to main content
gamedev.net
🔒 Locked

[java] accessing files from web-page applets

Started by madeUpNames Dec 29, 2002 at 9:37 AM 5 replies 950+ views
Original Post
madeUpNames
madeUpNames
i''ve most liekly overlooked this somewhere, but, is it possible to perform i/o on files held remotely from a web-page applet? (e.g. for recording high scores) thanks in advance!
Big Sassy
Big Sassy
It may be possible if you sign your jar file containing any classes that directly or indirectly access the file you want to save to. I used this method to access a database to save high scores for a game I did, but I''ve never used to access a normal file. I ran across a thread on sun''s java forums once that described how to do it step by step. Unfortunately I lost the URL to it. I''m sure you could find it if you looked though.

***********************
          
markuskidd
markuskidd
Doing IO directly from your applet to your server is a bad idea, because that will open you up to all sorts of exploits. Best solutions would be to invoke a script on the server or perhaps have your own daemon running which accepts a TCP connection on a specific port of your server which processes high scores. Neither of these will require your jar to be signed.
Star Dart - Java Multiplayer Space Combat at http://www.stardart.net/
Joltman
Joltman
Try using Servlet, since your already in the stuck with Sun you might as well give it a shot(instead of php that is)

//Jolt
The nice thing about C++ is that only your friends can handle your private parts.
BlackBox
BlackBox
Here is how to sign an applet:
http://forum.java.sun.com/thread.jsp?forum=63&thread=174214&tstart=15&trange=15

I never manage to make it work,
maybe you will have better luck!

----------------------------
^_^
---------------------------- ^_^
rjahrman
rjahrman
Yeah, you need to call a CGI on your server as if it were a webpage. The Java implementation is easy, what''s going to get you is the CGI programming (if you''ve never done it before). However, you don''t HAVE to use PHP . . . Perl would work just as well (and is my personal favorite) . . . if you got into any serious CGI programming, PHP would be laughed upon (for example, cgi-resources.com has 3x as many Perl scripts).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.