Código PHP:
<?php
$uploaddir = 'upload/';
chmod($uploaddir,777);
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
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>";
?>
Me da estos errores
Cita: Warning: chmod(): No such file or directory in c:\program files\apache group\apache\htdocs\upload\4to.php on line 3
Warning: move_uploaded_file(upload/header_ayuda.gif): failed to open stream: No such file or directory in c:\program files\apache group\apache\htdocs\upload\4to.php on line 6
Warning: move_uploaded_file(): Unable to move 'C:\WINDOWS\TEMP\php122.tmp' to 'upload/header_ayuda.gif' in c:\program files\apache group\apache\htdocs\upload\4to.php on line 6
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => header_ayuda.gif
[type] => image/gif
[tmp_name] => C:\WINDOWS\TEMP\php122.tmp
[error] => 0
[size] => 141
)
)
Nota: Estoy trabajando en Win2003 Server Enterprise Edition, Apache/1.3.24, PHP 4.3.2 y MySQL 4.0.18
Salu2