Help : Uploading File Error

Any problem with PHP can be disscused here
Post Reply
frisky168
Posts: 28
Joined: Sun Mar 11, 2007 11:44 am

Help : Uploading File Error

Post by frisky168 »

Hello guys,

I had a problem with my code in uploading file.. I include here the codes.. Could anyone please take a look with this code and tell me what is the error. Thank you in advance.

His message:

Quote:
hi! im trying to upload a file and send a confirmation to site owner that a user has uploaded a file, i have set the folders into full permission but
why am i getting this error::::

Warning: copy(public_html/uploads/SWORD.jpg): failed to open stream: No such file or directory

is there something wrong with the scripts????



Code:
$tempname = str_replace(" ","_",$_FILES['uploadedfile']['name']);
$destination_file = "uploads/".$tempname;

$source_file = $_FILES['uploadedfile']['tmp_name'] ;

if(copy($source_file, $destination_file)) {
$msg = "Uploaded $source_file to $ftp_server as $destination_file";
$address = $_SESSION['current_user'];
$fname = $_SESSION['first_name'];
$lname = $_SESSION['last_name'];
$filename = $tempname;
mail("email@email.com", "File Upload by $fname $lname", "http://www.domain.net/uploads/".$filename, "From: domain.com" );
}else{
$msg = "Upload Failed! Please try or check path of file to be uploaded.";
}


Thank you


Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

have you chmodded directory with 777 (0777) ?
Image
Post Reply