设置 enctype 后,使用表单发布文件只会使 PHP 脚本挂起

Posting file with form just makes PHP script hang when enctype set

enctype 设置为 multipart/form-data 时,我使用 POST 方法上传文件的表单只会使接收脚本挂起(或无法正确加载) .在 Safari 中,脚本崩溃(放弃)需要几分钟,但在 Chrome 中它会立即崩溃。 down 我的意思是用户被带到网站的根目录 (/)。

在错误日志中找不到任何错误。

我已经设法在没有 enctype and/or 文件输入的情况下使表单功能正常,但是很自然地,没有文件被发布。

它是 PHP7 的 WAMP 服务器。 Ini 设置都经过仔细检查,足够大。

这些脚本在几周前一直有效,但 IT 部门无法指出可能是原因的任何具体更新。

<form name="fileupload" action="fileReceive.php" enctype="multipart/form-data" method="POST">
    <input type="text" name="ahiddenvalue" value="The hidden value">
    <input type="file" name="upfile" id="fileToUpload" accept=".pdf, application/pdf">
    <input type="submit" name="Upload" value="Upload file">
</form>

文件接收脚本,fileReceive.php:

exit("<pre>".print_r($_REQUEST)."\n".print_r($_FILES)."</pre>");

浏览器地址栏的loading栏刚开始,在Safari中挂了两分钟左右。错误日志中没有关于 max-execution_time 的消息。

我找到了原因:url 重写是在 Apache 中设置的,只有小写文件后缀。当试图获取带有大写文件后缀的文件时,'url rewritten' 的脚本没有捕获到该文件,只是通过显示站点的首页停止了一切。