如何停止一个超大文件的上传,而上传过程? [英] How to stop a oversize file upload while upload is in process?

查看:84
本文介绍了如何停止一个超大文件的上传,而上传过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了Apache,PHP。

I'm using apache, PHP.

因此​​,对于PHP,即使我设置最大文件大小,如果有人上传一个巨大的文件,它会上传整个事情到服务器,然后PHP返回错误。是对的吗?

So, for php, even I set max file size, if someone upload a huge file, it will upload the whole thing to server, and then PHP return error. is that right?

我想在Web服务器或PHP停止时,文件大小或请求大小超过一定的大小。

I would like the web server or PHP to stop when the file size or the request size is larger than certain size.

有没有办法做到这一点?我记得是这样设置的post_max_size或设置东西的apache.conf但不能肯定是否当文件越过最大限制它就会停止。

is there a way to do it? I remember something like setting post_max_size or setting something in apache.conf but not sure if it will stop when the file goes over the max limit.


  • 我不信任客户端验证。所以,我在寻找Apache或PHP级解决方案。 :)

推荐答案

Apache的LimitRequestBody ,据我所知,这只是在看的时候....停止连接

Apache's LimitRequestBody, afaik, it just stops the connection when going over....

这篇关于如何停止一个超大文件的上传,而上传过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆