Solved

writing file on the server...

Posted on 2000-03-30
4
248 Views
Last Modified: 2013-12-25
HI,

I am using Netscape Server on Solaris with cgi. I want to write file on the server from my cgi, issms it does not allow me to create file to the desired directory.

Is there is any setting I am missing or it has to do something with 'rights'.

Please clarify...

Thanx
Ajay


0
Comment
Question by:ajayksh
4 Comments
 
LVL 1

Expert Comment

by:lambda
ID: 2668729
Could be that you don't have permission to write to that particular directory in the server.
0
 
LVL 10

Expert Comment

by:makerp
ID: 2668967
the directory that your trying to write to needs write permissions for the account that the web server runs under. you may have to also configure the web server so it knows it can write to that dir. to change the control for the web server account speek to your systemn admin
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2669501
when you run a script using CGI, it runs as a process under a given user (typically nobody). Chances are this user does not have the write permission to that directory.

to test this, try running a sample script that you can run from the command prompt & also from the browser.

At the end of each check if a file has been created in that directory.
if the file is created when you run from the command prompt, but not from the browser then my doubts are confirmed.

here is the sample script

=========test.pl
#!/usr/local/bin/perl


print "Content-type: text/html\n\n";

## the directory must be replaced with your directory name.
open(FILE,">/tmp/test.txt") || die $!;

print FILE "OK\n":

close (FILE);


Hope that helps
0
 
LVL 2

Accepted Solution

by:
saar071697 earned 30 total points
ID: 2837620
try to write the file at the main directory. if it also dont work , it may be that your cgi cannot create files : try to make the file youre self and the try to write to it.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now