Forum Moderators: coopster
I have written a simple file upload code. I have double check the the URL of the upload folder etc are correct but still photos are not uploaded, when i use is_uploaded_file function it gives me error , here is the code ...
PHP Code:
move_uploaded_file($hname,$_SERVER['DOCUMENT_ROOT']."/images/".$newname.$p_type);
//all the variables in the above function have correct values i
//have checked it by printing them
if (is_uploaded_file($_FILES['photo']['tmp_name'])) {
echo "File ". $_FILES['photo']['name'] ." uploaded
successfully.\n";
echo "Displaying contents\n";
readfile($_FILES['photo']['tmp_name']);
} else {
echo "Possible file upload attack: ";
echo "filename '". $_FILES['photo']['tmp_name'] . "'.";
}
as a result i always gets this following error
Code:
Possible file upload attack: filename 'Array'.
first of all instead of displaying temporary file name it displayes ARRAY that means the tmp_name is holding array in it ...
Everything seems to be ok but i can't upload images, the very same code works on my all other sites... can this be due to my new server settings? or is it something to be set on server?
your help is really appreciated