?
Solved

writing file on the server...

Posted on 2000-03-30
4
Medium Priority
?
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 60 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

771 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