如何限制正在上传的文件的大小apache + django [英] How to restrict the size of file being uploaded apache + django

查看:108
本文介绍了如何限制正在上传的文件的大小apache + django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制要上传的文件的大小
我使用django 1.1与apache。
如果说大小大于100MB,我可以使用apache来显示一些html错误页面。

How to restrict the size of file being uploaded. I am using django 1.1 with apache. Can I use apache for this and show some html error page if say size is bigger then 100MB.

谢谢。

推荐答案


我的意思是在上传文件

I mean before uploading the file

在客户端这是不可能的...

On client side it isn't possible...

我建议写一个自定义上传处理程序,并覆盖 receive_data_chunk

I suggest to write a custom upload handlers and to override receive_data_chunk.

示例: QuotaUploadHandler

这篇关于如何限制正在上传的文件的大小apache + django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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