uploading a file to server using php ?

Mask

New member
I am trying to upload a file to the server, but the problem that when I open upload.php and click on submit I get a message saying "no file chosen" !!

I need help with my code below ,,, thanks

<html>
<head>
<title>Upload</title>
</head>
<body>
<?php
if($File){
print ("File name: $File_name<P>\n");
print ("File size: $File_size<P>\n");
if (copy ($File, "users/$File_name")) {
print ("Your file was successfully uploaded!<P>\n");
} else {
print ("Your file could not be copied.<P>\n");
}
unlink ($File);
}
print ("Upload a file:\n");
print ("<FORM ACTION=\"upload.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n");
print ("File <INPUT TYPE=FILE NAME=\"File\" SIZE=20><BR>\n");
print ("<INPUT TYPE=SUBMIT NAME=\"SUBMIT\" VALUE=\"Submit\"></FORM>\n");
?>
</BODY>
</HTML>
 
Back
Top