Finish the Get method for webdav.

This commit is contained in:
zicla
2019-04-21 15:14:40 +08:00
parent 8461218d63
commit 18dc7f7e2c
4 changed files with 69 additions and 41 deletions

View File

@ -505,7 +505,7 @@ func (this *MatterService) DownloadFile(
this.PanicError(e)
}()
//如果是图片或者文本或者视频就直接打开。其余的一律以下载形式返回
//根据参数添加content-disposition。该Header会让浏览器自动下载而不是预览
if withContentDisposition {
fileName := url.QueryEscape(filename)
writer.Header().Set("content-disposition", "attachment; filename=\""+fileName+"\"")