V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
RangerWolf
V2EX  ›  Python

SAE storage + Django 上传文件只能 2.5MB?

  •  
  •   RangerWolf · 2014-10-23 09:19:58 +08:00 · 2891 次点击
    这是一个创建于 3444 天前的主题,其中的信息可能已经有所发展或是发生改变。
    官网虽然贴了一个大文件上传的文档链接,但是打开了完全看不到相关内容。难道大文件(>2.5MB)就只能通过客户端上传了吗?

    暂时只想到一个办法就是修改Django默认的2.5MB限制,比如修改到50MB
    不过如果使用这种办法,会不会造成服务器内存使用太多,从而如果多人使用会严重影响性能?

    当然另外一个方法就是放到自己的VPS了

    第一次搞这方面的东西,没啥经验,请大家帮忙出出主意~
    1 条回复    2014-10-23 13:01:50 +08:00
    glasslion
        1
    glasslion  
       2014-10-23 13:01:50 +08:00   ❤️ 1
    https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#upload-handlers

    自己写个 Fileuploader 呗, Django 大文件默认是上传到/tmp (https://github.com/django/django/blob/731f313d604a6cc141f36d8a1ba9a75790c70154/django/core/files/uploadhandler.py)

    虽然SAE没给/tmp的权限,但提供了一个 `sae.core.get_tmp_dir()` 的API
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1488 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:19 · PVG 01:19 · LAX 10:19 · JFK 13:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.