Quote:
quote:
why don't you try using copy() function instead...
|
Well that doesn't have anything to do with the problem. The permissions error that you're getting is coming up because you haven't set the proper permissions for the destination directory. This can be done by either logging into the server via telnet to the command prompt and issuing the chmod command there or by using PHP to pass the chmod command. With most server configurations the PHP option doesn't work because the Unix user for PHP e.g. 'nobody' doesn't match that of the owner of the directory, which is typically your system access user name.
To do this via telnet, log into the server via telnet and navigate to the directory.. typically you'll start out at the root directory for your website then you can navigate into the directory hierarchy via the 'cd' command.
cd some_directory
Then when you've reached the directory you'll need to plug in the chmod command..
chmod 664
664, grants read and write to the owner and the owner's group and read only to the world.
777, grants read, write and execute to every group.
4 represents read permission
1 represents execute permission
2 represents write permission
Nik gave me a fantastic tutorial on the chmod setting.. and that's buried somewhere in the old p2p forums.. with a little searching you could probably locate it. I'm in a bit of a rush or I would locate it for you. Basically something like 444 is read only for all three groups... The first number represents the owner, the second number represents the owner's group and the third number represents the world at large.
In my experience with certain ISP's I've only been able to get upload scripts working by issuing a chmod 777, which gives read, write and execute priviledges to all three groups. I haven't really dug too deeply to find a way around it. In order to restict access to your PHP script only you would need to change the owner to 'nobody' via the chown command, which many ISP's block.
I'm no expert on this stuff... and I could very well be wrong about one or more of the details. I do know that chmod 777 will get the script working. But be warned it does create a security hole.
Here's the PHP page on the chmod function which does provide a little insight into the chmod command:
http://www.php.net/chmod
Also some FTP programs support changing the chmod command natively eliminating the need for telnet. One that comes to mind is WS FTP. Which last I checked was shareware that could be downloaded for unlimited free use.
Time to get on with Turkey Day, good luck!
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::