[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] File ownership?



Hi All,

I have a PHP script that writes the output of a form to a csv file.
The customer then goes to an address and downloads the text file to import
into their system
They then run a little Perl script from the browser to purge the order file
The Perl script looks like this:

#!/usr/bin/perl  --
rename ("/home/sites/site95/web/aformmail-1.1/email.txt",
"/home/sites/site95/web/aformmail-1.1/email.old");
system("cp",
"/home/sites/site95/web/aformmail-1.1/empty.txt","/home/sites/site9
5/web/aformmail-1.1/email.txt");
print "Content-type: text/html\n\n";
print qq!
<html><body><H1>Brochure Request File Purged\!</h1></body></html>!;

The problem is that when it copies the empty file to the live file it does
so with the wrong permissions.  I have tried putting in a system("chmod"...)
command to set them back but this doesn't work.  I think this is a file
ownership problem.

Can anyone throw any light on this or suggest a better way of doing it.  The
PHP script that writes the file needs to have 777 permissions.  At the
moment the customer calls me, tells me that he's purged the file.  I then go
in and manually chmod it or else visitors see a Internal server error when
they submit the form.

Cheers,

Andy
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 06/12/02