这是我的 page
这是我的表格
<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>
我把这个放在上面
<?php print_r($_FILES);?>
脚本在本地完美运行,当我在服务器上安装它时,我什么也得不到....
我有一套
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 />';
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 />';
我认为它可能是 gd 但它已启用
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
最佳答案
抛出 <?php phpinfo(); ?>
服务器上的文件,然后查看 file_uploads
部分以确保它已设置为开。我也会检查 phpinfo(),因为我有时会看到仅检查 ini_get() 的奇怪现象....
您还检查过 Firebug 以确保文件正在发送吗?
关于php - 为什么 $_FILES super 全局总是空的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5334504/