473,609 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.A ccessControlExc eption: 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 6653
I may be wrong, but i don't think applets has got access to the FS... for
security reasons...

// Christopher

"SomeDude" <ra*******@hotm ail.com> skrev i meddelandet
news:71******** *************** **@posting.goog le.com...
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.A ccessControlExc eption: 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*******@hotma il.com (SomeDude) wrote in message news:<71******* *************** ***@posting.goo gle.com>...
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.A ccessControlExc eption: 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.cc cd.edu (Stephen Gilbert) wrote in message news:<56******* *************** ****@posting.go ogle.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*******@hotma il.com (SomeDude) wrote in message news:<71******* *************** ***@posting.goo gle.com>...
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.A ccessControlExc eption: 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.A ccessControlExc eption: 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.prohostin g.com/playgo. Thanks

Olivier

sg******@occ.cc cd.edu (Stephen Gilbert) wrote in message news:<56******* *************** ****@posting.go ogle.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*******@hotma il.com (SomeDude) wrote in message news:<71******* *************** ***@posting.goo gle.com>...
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.A ccessControlExc eption: 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
2926
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 form, PHP reads the .php file in a variable. It then processes it: adds the user comments to the var and writes the modified file back to disk. Next time the user opens the page (s)he sees te comments (s)he and others added. So what I have is a...
5
1919
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 bytes at a rate of 30 frames per second. This works fine, without frame loss, and I can display the two framestreams on screen. Now I would like to write these frames to my disk too (2 10000rpm in
1
6752
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 another. I want this to be best optimized, so that speed can be very good. Suggestion in this regard will be appreciated.
3
1632
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 download directory specified in the scrip. Can anyone see where I have gone wrong Also I want to show the question Index and Question on screen as a list. Ive put echo $nt, $nt;
4
2010
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 also need to be copied over to another computer, that is running Windows 2000 Professional version. This goes all right for some time, but then I start receiving the following error. IOException: No more connections can be made to this remote...
1
1413
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 C:\Temp etc. But when i try to get a little bit clever and try a write to something like request.applicationpath + "/mydir/myfile.pdf"
6
2071
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 writing new files to the created directory results in an access denied error. Thanks to a script by Keith Brown, I was able to determine who my application was running as: > ====================================================== >
2
1446
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 list</TITLE></HEAD><BODY><H2><CENTER>%s</CENTER></H2><BR><H3><center>%s</center></h3></body></html> Its working fine, but will it work if the script recieves thousands of request simultaneously. Can this script writes files simultaneusly or will all the request queued and processed one by one....
14
3341
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 the user's choice. Dim TextString As String TextString$ = txtSave Open Path$ For Output As #1 Print #1, TextString$ Close #1 The only problem that I encounter is that I get this error when the user tries to delete that directory later:
3
2168
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. But when I read the file the file seems to be incomplete. Further inspecting it has seemed to have stopped writing to the file at a certain point. Something in my code? a bug? System: Linux 2.4.31 (Slackware), Python 2.5c1 Any help is greatly...
1
8220
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8404
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6997
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6056
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4017
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1386
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.