banxi1988
V2EX  ›  V2EX

V2EX没有检测上传图片类型,导致抛出错误,原因我虽然选择了svg类型的图片,但是还是上传了。 结果:

  •  
  •   banxi1988 · Nov 25, 2012 · 2825 views
    This topic created in 4992 days ago, the information mentioned may be changed or developed.
    Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1042, in _execute
    getattr(self, self.request.method.lower())(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1809, in wrapper
    return method(self, *args, **kwargs)
    File "/www/v2ex/galaxy/handlers/web/settings.py", line 373, in post
    avatar73 = self.rescale(avatar, 73, 73)
    File "/www/v2ex/galaxy/handlers/__init__.py", line 432, in rescale
    img = pil.open(input_file)
    File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1980, in open
    raise IOError("cannot identify image file")
    IOError: cannot identify image file
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3321 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:54 · PVG 18:54 · LAX 03:54 · JFK 06:54
    ♥ Do have faith in what you're doing.