That is really bizarre. I have this simple form on a document, say index.php:
[code]
<form id=”file_upload_form” method=”post” enctype=”multipart/form-data” action=”upload.php”>
<input name=”file” id=”file” size=”27″ type=”file”><br>
<input type=”submit” name=”action” value=”Upload”><br>
</form>
And in upload.php I simply have:
[code=php]
<?php
var_dump($_FILES);
?>
Surprisingly I get [B]NULL
But if i perform an auto submit, that means I change the action of the form to action=””
[code]
<form id=”file_upload_form” method=”post” enctype=”multipart/form-data” [COLOR=”Blue”]action=””[/COLOR]>
And i move the var_dump() in the same document, in the index.php, here it is: the $_FILES array appears!
How’s that? ?
I tried to see if there are some restrictions into the ini configuration, thus I wrote this into the upload.php
[code=php]
<?php
echo ‘file_uploads: ‘. ini_get(‘file_uploads’). ‘<br />’;
echo ‘upload_tmp_dir: ‘. ini_get(‘upload_tmp_dir’). ‘<br />’;
echo ‘upload_max_filesize: ‘. ini_get(‘upload_max_filesize’). ‘<br />’;
echo ‘max_file_uploads: ‘. ini_get(‘max_file_uploads’). ‘<br />’;
?>
And the result is:
[code]
file_uploads: 1
upload_tmp_dir: C:WINDOWSTemp
upload_max_filesize: 2M
max_file_uploads:
Which I think shows that I have permission to upload a file.
Important: the uploaded file is a small PNG file of 20 KB, thus the size can not be the problem.
Any ideas?