Link to home
Start Free TrialLog in
Avatar of ajayksh
ajayksh

asked on

writing file on the server...

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


Avatar of lambda
lambda

Could be that you don't have permission to write to that particular directory in the server.
Avatar of Paul Maker
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
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
ASKER CERTIFIED SOLUTION
Avatar of saar071697
saar071697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial