【问题标题】:Files are not uploaded文件未上传
【发布时间】:2016-09-18 07:09:58
【问题描述】:

我的表格很简单

<form enctype="multipart/form-data" action="#" 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> 

在同一页面上,我将 $_FILES 检查为 if(isset($_POST) && count($_POST) > 0){ echo "<pre>"; print_r($_REQUEST); echo "</pre>"; echo "<pre>"; print_r($_Files); echo "</pre>"; die; }

我看不到 $_FILES 中的任何数据。我检查了服务器设置

file_uploads = On,upload_max_filesize = 64M, max_file_uploads = 20

我正在使用 wamp 服务器。任何帮助将不胜感激。

【问题讨论】:

  • 你需要大写$_FILES而不是$_Files
  • 您能否也显示用于保存文件的代码 - 即:处理上传?
  • @Object Manipulator OMG 那是个问题。感谢您的帮助

标签: php forms file-upload


【解决方案1】:

你写print_r($_Files);而不是print_r($_FILES);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-14
    • 1970-01-01
    • 2019-06-30
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    • 2012-06-04
    • 1970-01-01
    相关资源
    最近更新 更多