[gae]增加对 svg 的支持
GAE 对于 svg 的支持,是把它当做 octet stream(application/octet-stream) 来处理。如果是这样,当网址的结尾是 foo.svg 这种,就会得到下载的窗口,而不是想像的显示图案。
若是要让它可以是显示图案,要让 server 可以在 mime type 指定成 image/svg+xml。
因此,就要在 app.yaml 告诉 GAE 了。
以下是范例:[参考1]
- url: /svg/(.*.svg)
static_files: svg/1
upload: svg/(.*.svg)
mime_type: image/svg+xml
以下就是我测试用的 svg,是用 sozi 做的。使用 chrome, firefox 才可以看。
http://rickystockinfo.appspot.com/svg/aot.svg
扫描二维码关注公众号,回复:
7154996 查看本文章
分享