tags:

views:

40

answers:

3

I'm having issues with an automatic parser which reads files that have been uploaded via FTP onto one of our hosts.

Basically it returns with the following error

Warning: rename(/home/domain.com/thefile.zip,/home/domain.com/used/thefile.zip) 
[function.rename]: Permission denied in /home/domain.com/public/www/parser.php on line 546

Unfortunately the third party providing the zip file is only willing to send it to the root directory.

I'm unsure what needs to be done facilitate moving the file out of the root directory and into the 'used' directory. Any insights into this would be greatly appreciated.

A: 

Try chmod 777 on the folder "used"?

cypher
I've checked the permissions and they're set to 02777.
Sasha
A: 

Have you got read permissions on that directory? and if so try using the exec() function with the cp command.

exec('cp "/path/zip.zip" "/path/new/zip.zip"', $ouput);

Currently you are attempting to alter a file in a directory that you probably dont have write permissions in.

DRL
This doesn't give me any warnings, but doesn't move the file either.
Sasha
I have just edited the post to include the output parameter, this will contain any errors returned by executing the command, will give you a better idea of what is going on i think.
DRL
Thanks for the updated information. I've had a look at this and I don't think that the server is going to give me permissions to do this. The following information is given to me: output = array(0) { }, return_var = int(127)
Sasha
A: 

Are you sure you don't want to do the following? Does the 'used' folder exist?

mkdir('used');
copy("file.zip", "used/file.zip");
unlink("file.zip");
Andy
Unfortunately this gives the same permission denied error.
Sasha