Forum Moderators: coopster
Warning: move_uploaded_file(../uploads/): failed to open stream: Permission denied in C:\webserv\nduk\webroot\insertdata.php on line 204
Warning: move_uploaded_file(): Unable to move 'C:\PHP\uploadtemp\php54.tmp' to '../uploads/' in C:\webserv\nduk\webroot\insertdata.php on line 204
I am using XP and have tried to set permissons through the propities panel but to be honest I dont know what I really fidding with I changed the web site sharing to read and write permissons but still no joy can anyone help? the code I wrote is below. The name image is the one submitted in the form.
if (move_uploaded_file($_FILES['image']['tmp_name'], "../uploads/{$FILES['image']['name']}")) {
print '<p><font color="red">The file has been uploaded</font></p>';
} else {
print '<p>The file could not be moved because </p>';
$img_name = 'noimage.jpg' ;
}
Also, you should use the is_uploaded_file() function to test if a file has been uploaded before you move it.
if (is_uploaded_file($_FILES['image']['tmp_name']))
{//move file
}
Does this file store all the information here for every upload added or is it overwritten with the new file uploaded when a picture is submitted?
Please could you help?