Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
能够支持非图片文件的上传和下载,
zimg.lua中做2处修改:
上传时http头中加 zimg-filename:文件名 ,
例如: zimg-filename:a.pdf
下载非图片文件时需要加p=0参数
上传示例:
curl -H "Content-Type:application/octet-stream" -H "zimg-filename:a.pdf" --data-binary @a.pdf "http://localhost:4869"
下载示例:
curl "http://localhost:4869/5b43fa8518caa20cce5fea551228d7a3?p=0" > b.pdf
在浏览器中输入文件对应的url地址后,会弹出下载框提示下载文件,默认的文件名就是zimg-filename指定的文件名。
例如:
http://localhost:4869/5b43fa8518caa20cce5fea551228d7a3?p=0