PHP on Windows File upload Problem
Posted: Thu Oct 05, 2006 10:16 am
I have the following code on my page:
If I post a file then the print_r($_FILES) and print_r($_POST) returns empty ... but if I don't post a file, I get back:
Array
(
[userfile] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
)
Array
(
[MAX_FILE_SIZE] => 30000
)
Is there some configuration setting that I am missing? Please help!
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<?php
print_r( $_FILES );
print_r( $_POST );
?>
</head>
<body>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
</body>
</html>Array
(
[userfile] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
)
Array
(
[MAX_FILE_SIZE] => 30000
)
Is there some configuration setting that I am missing? Please help!