简体   繁体   English

php在大文件上传时丢失表单字段

[英]php losing form fields on big file upload

so i've read that php clears the $_POST variable when an upload or other data exceeds the limits on POST data. 所以我读到当上传或其他数据超过POST数据限制时,php会清除$ _POST变量。 Thus if the user uploads a really big file which php/apache rejects, their form fields will get cleared out and you wont be able to repopulate them. 因此,如果用户上传了php / apache拒绝的非常大的文件,他们的表单字段将被清除,您将无法重新填充它们。 is there a way to get around this? 有办法解决这个问题吗? Is this a php issue or an apache issue? 这是一个php问题还是一个apache问题?

is there a way to get around this? 有办法解决这个问题吗?

Many ways, one of them is just to give a 500 response and dying straight away. 许多方式,其中之一就是给出500响应并立即死亡。

Is this a php issue or an apache issue? 这是一个php问题还是一个apache问题?

Can be both, but I assume it's just that you're hitting the PHP limit for post max size or the memory limit. 可以两者兼而有之,但我认为只是你达到了post max max或内存限制的PHP限制。 Configure your server that you have enough resources to handle the file uploads you wish. 配置您的服务器,您有足够的资源来处理您希望的文件上传。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM