why is the $_FILES super global always empty
here is my page
here is my form
<h2>Upload Photo</h2>
<form name="photo" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
Photo <input type="file" name="image" size="30" /> <input type="submit" name="upload" value="Upload" />
</form>
i have this on top
<?php print_r($_FILES);?>
the script works perfectly locally and when i have it on the server i get nothing....
I have this set
ini_set ('max_execution_time', '86400');
set_time_limit(86400);
ini_set("memory_limit","128M");
ini_set('max_upload_filesize', "30M");
ini_set("post_max_size", "150M");
ini_set("session.gc_maxlifetime","10800");
echo 'file_uploads: '. ini_get('file_uploads'). '<br />';
开发者_StackOverflow社区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 />';
I thought it maybe gd but its enabled
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
Throw a <?php phpinfo(); ?>
file on the server and then look in the file_uploads
section to make sure it is set to on. I would check phpinfo() too since I have sometimes seen oddities with just checking ini_get()....
Also have you checked with Firebug to make sure that the file is being sent?
I Had the same probleme and i catched by edtiting my .htaccess
File because he containe a function that make a rewriting in Url to hide the extension in the Web Page.
maybe you have the same probleme.
Change the name of .htaccess
file to Test it.
精彩评论