473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Writing to files on a server

Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude
Jul 17 '05 #1
5 6643
I may be wrong, but i don't think applets has got access to the FS... for
security reasons...

// Christopher

"SomeDude" <ra*******@hotmail.com> skrev i meddelandet
news:71*************************@posting.google.co m...
Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude

Jul 17 '05 #2
Hi,

Applets are downloaded and run on the user's local machine;
they can't write files on the server, because they are not
running on the server. However, you could use a CGI program
or a servlet, running on the server, and have your applet
send the data back to the program running on the server,
and then have that program write the data.

You won't have any luck trying to use ports (sockets)
between the two applets, because applets are prohibited
from connecting to hosts other than the host that served
the applet.

--Steve

ra*******@hotmail.com (SomeDude) wrote in message news:<71*************************@posting.google.c om>...
Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude

Jul 17 '05 #3
I just had to make a client/server Go game for one of my classes. The
solution we chose was to give the client Java applications via Java
Web Start and then use Java RMI to get the clients to talk to the
server. This worked pretty well.

If you want to use applets I agree with Steve that the best way to go
is to write a servlet. This will mean you need a servlet container
(e.g. Tomcat), which may be why Steve mentioned CGI.

Chris

sg******@occ.cccd.edu (Stephen Gilbert) wrote in message news:<56**************************@posting.google. com>...
Hi,

Applets are downloaded and run on the user's local machine;
they can't write files on the server, because they are not
running on the server. However, you could use a CGI program
or a servlet, running on the server, and have your applet
send the data back to the program running on the server,
and then have that program write the data.

You won't have any luck trying to use ports (sockets)
between the two applets, because applets are prohibited
from connecting to hosts other than the host that served
the applet.

--Steve

ra*******@hotmail.com (SomeDude) wrote in message news:<71*************************@posting.google.c om>...
Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude

Jul 17 '05 #4
SomeDude wrote:
Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude


you could write a program to run on the server that is your "go server"
that will take clients and connect them together. the applet would be
the client. The only problem with this method would be that you would
have to be able to have the program running on the server...

-Ben
Jul 17 '05 #5
Thank you everyone for your awnsers. All of this sounds too
complicated... I just wished there was an easy way to do what I want
to do. I guess I'll find a new hobby now, leaving my Go applet forever
unfinished. If you want to see what I did, go to
earth.prohosting.com/playgo. Thanks

Olivier

sg******@occ.cccd.edu (Stephen Gilbert) wrote in message news:<56**************************@posting.google. com>...
Hi,

Applets are downloaded and run on the user's local machine;
they can't write files on the server, because they are not
running on the server. However, you could use a CGI program
or a servlet, running on the server, and have your applet
send the data back to the program running on the server,
and then have that program write the data.

You won't have any luck trying to use ports (sockets)
between the two applets, because applets are prohibited
from connecting to hosts other than the host that served
the applet.

--Steve

ra*******@hotmail.com (SomeDude) wrote in message news:<71*************************@posting.google.c om>...
Hi, I have a question on file writing. I am not very experienced in
Java programming. My hobby right now is to write an applet where 2
persons could play Go together (it is a board game). The offline
interface is done but I was wondering how to send information between
the two players. Since I am not very experienced in Java and I am just
a hobby programmer, I found that programming a port listening
interface was too difficult. My idea was to write the moves the player
made in a text file on the server of my web page (I use prohosting, a
free server). The problem is that I get a
java.security.AccessControlException: access denied error everytime I
try to write to the file. It also does the same thing if I run the
applet on my computer. Do I have to get a certificate to write on the
server? I do not wish to write files on the user's computer, only on
my free server. Is it possible to do this? Thank you

Some Dude


Th
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc | last post by:
Hello, I have a question about how PHP handles multiple file reads/ writes. I made a page containing a self-submitting form where the user can type his name, topic and a text. When he submits the...
5
by: Ben Jeurissen | last post by:
Hello, I have to deal with the following issue in C++: Two threads are started from the main thread, both capturing images from a different firewire camera. Both threads take shots of 460800...
1
by: T.S.Negi | last post by:
Dear All, Please suggest some of the best practices for writing SQL server stored procedures? I'm writing a business function (stored procedure), which calls many-stored procedure one after...
3
by: Ian Davies | last post by:
Hello I have the following code which changes directory, creates a file and then writes rows to it. It works fine except the file is created in the folder the php script is in instead of the...
4
by: Lenard Gunda | last post by:
Hello! I have created a program, that receives files, and then stores them locally for later access. This program is run on a Windows 2000 Server computer as a system service. Some of the files...
1
by: Admin | last post by:
Hi there I want to write to the server with a Brinkster type account setup using ASP.net. I kinda understand how to do it on my own server. It seems pretty straight forward to write to a...
6
by: darrel | last post by:
I'm struggling with an odd permissions problem I have with one of my functions. It takes a file, writes a directory, and then uploads some files to it. This works. Once. Any subsequent attempt and...
2
by: amaltasb | last post by:
I have a CGI script on server which process a form and writes its content on a file like fp = open(fname, 'w') fp.write('<HTML><HEAD><TITLE>Cool...
14
by: ohshhitscarl | last post by:
I am in the process of creating an application that runs in the background and performs several tasks and works as a server. At a point in my application I have it write some files to a directory of...
3
by: Adonis Vargas | last post by:
I am writing a program that walks a directory full of mp3s reads their ID3 data (using Mutagen), this part works perfectly. The problem is I write these tags to a CSV file through the CSV module....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.