Warning of permission on server when i try to copy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
altamash
Forum Newbie
Posts: 8
Joined: Mon Jul 21, 2003 6:03 am

Warning of permission on server when i try to copy

Post by altamash »

i m getting following Warning when trying to copy file to the server when i use COPY(); function CAN U SOLVE THIS PROBLEM

Warning: Unable to create '/usr/local/psa/home/vhosts/mydomain.com/httpdocs/myupload.htm': Permission denied in /usr/local/psa/home/vhosts/pakistancare.com/httpdocs/myupload.php on line 15
Soory


My code is as follows

<?
if(!empty($userfile)) {

//copy the file
print "Name :: $userfile_name<br>";
print "size :: $userfile_size<br>";
print "Type :: $userfile_type<br>";
print "Temp Dir :: $userfile<br>";
//copy($userfile, "C:\apache\htdocs\Php\Upload/$userfile_name") or die("Soory");//WORKING WELL

copy($userfile, "/usr/local/psa/home/vhosts/mydoanain.com/httpdocs/$userfile_name") or die("Soory");

//destroy the uploaded file
unlink($userfile);

//display message
echo("file uploaded<br>");
print "<img src=\"C:\apache\htdocs\Php\Upload\$userfile_name\">";

}
?>


Warning: Unable to create '/usr/local/psa/home/vhosts/mydomain.com/httpdocs/myupload.htm': Permission denied in /usr/local/psa/home/vhosts/pakistancare.com/httpdocs/myupload.php on line 15
Soory
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

The user that the webserver runs your script as does not have write permissions in that directory...
Post Reply