Re: File Copy

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

 



Aidal

Could you post the relevant parts of your code so we have a little context to work in?

You say you're copying a file from one location to another on the same server. If this is the case you are very unlikely to be in need of the ftp family of functions, which are only valid for use over an established ftp connection.

I suspect that the file is indeed now owned by the webserver

has it changed from aidal:somegroup to nobody:nogroup or something like that?

Post us some code and the answers you get will probably be more useful

Cheers

Chris

Aidal wrote:
ftp_chmod() is part of PHP 5 and I'm working with PHP 4.3.1.

I tried the ftp_raw('CHMOD 777 filename.jpg'); doesn't work either though :(

"Silvio Porcellana" <sporc@xxxxxx> wrote in message
news:41761F4A.4050206@xxxxxxxxx

Aidal wrote:

Hi NG.

I'm experiencing some problems when trying to copy a file from one

location

to another on the web server.

example:

dir1/subdir1/some_image_name.jpg -->

dir2/subdir2/some_new_image_name.jpg

When I do this the file permissions changes and I'm no longer the owner

of

the file. I tried to use chmod('the_new_file', 0777); but it doesn't

work,

because chmod() wont let me change the permissions since I'm not the

owner

of this new file.


The owner should now be the user the Web server is running as. To change file ownerships you need to use the PHP FTP functions. Check out these pages: http://php.libero.it/manual/en/ref.ftp.php

HTH, cheers!
Silvio Porcellana



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux