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

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

问题描述


如何限制文件的大小上载。
我使用的Django 1.1与Apache。
我可以使用Apache,这和显示一些HTML错误页面,如果说规模更大然后100MB。

感谢。


解决方案

  

我在上传文件之前平均


在客户端是不可能...

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

例如:<一href=\"http://$c$c.djangoproject.com/browser/django/trunk/tests/regressiontests/file_uploads/uploadhandler.py#L7\"相对=nofollow> QuotaUploadHandler

Hi 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.

Thanks.

解决方案

I mean before uploading the file

On client side it isn't possible...

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

Example: QuotaUploadHandler

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

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