hola maestros estoy tratando de subir una foto usando algo que copie en el manual de php y no me funciona , osea si:
subidor.php:
<form enctype="multipart/form-data" action="subir1.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" >
Send this file: <input name="userfile" type="file" >
<input type="submit" value="Send File" >
</form>
subir1.php:
<?php
$uploaddir = "/home/httpd/html/misitio/prueba/"; //dado por mi hosting
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
echo $uploadfile ;
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
y me devuelve :
/home/httpd/html/misitio/prueba/recibo.jpg
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => recibo.jpg
[type] =>
[tmp_name] =>
[error] => 2
[size] => 0
)
)
¿alguien me puede orientar ?
nota mi hosting es version 4.3.3 y register_globals On .
http://www.php.net/manual/en/features.file-upload.php
muchas gracias...