我有一个如下的表单:
<form method="post" action="./action.php?a=create" enctype="multipart/form-data">
<input name="formType" type="hidden" value="file" required />
<input name="formParent" type="hidden" value="<?php echo $parentID; ?>" required />
<table class="fixed">
<tr>
<td>
<p>Display Name</p>
</td>
<td>
<input name="formName" type="text" placeholder="Enter File Name" autofocus autocomplete="off" required />
</td>
</tr>
<tr>
<td>
<p>Select a File</p>
</td>
<td>
<input name="formFile" type="file" placeholder="Select a File" required />
</td>
</tr>
<tr>
<td></td>
<td>
<button class="confirm btn-warning" type="submit">Submit</button>
</td>
</tr>
</table>
</form>
当我尝试上传小于20MB的文件到我的服务器时,一切正常。但是当我尝试上传1GB大小的大文件时,我的
$_POST
数据不设置。如何知道我的post数据未设置? 使用此表单访问操作页面时,它会检查所设置的
formType
并相应地显示/运行。但是,当我尝试上传较大的文件时,它会说$_POST ['formType']
未设置,尽管从表单中看来,它明确设置了。我的当前
PHP.ini
配置具有以下不同设置:upload_max_filesize = 5000M
和post_max_size = 5000M
我还有一个web.config
文件,其中声明:<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
<staticContent>
<mimeMap fileExtension=".zipx" mimeType="application/x-zipx-compressed" />
</staticContent>
</system.webServer>
<system.web>
<sessionState timeout="60" />
</system.web>
</configuration>
为什么在等待文件上传一段时间后,$_POST
数据会丢失?是否可以更改表单上传超时时间?
编辑:
print_r($_POST)
返回 Array ( )
sessionState
的超时时间限制? - Adam Terror_reporting(-1);
。 - Adam Techo "<br />FILES: "; print_r($_FILES);
。 - Adam TmaxAllowedContentLength
的方法,并提供了更详细的链接。 - Adam T