fix download
This commit is contained in:
parent
bce8586bc6
commit
417d861be6
1 changed files with 1 additions and 1 deletions
|
@ -243,7 +243,7 @@ func SingleDownload(ctx *middleware.Context, params martini.Params) {
|
||||||
contentType, isTextFile := base.IsTextFile(data)
|
contentType, isTextFile := base.IsTextFile(data)
|
||||||
_, isImageFile := base.IsImageFile(data)
|
_, isImageFile := base.IsImageFile(data)
|
||||||
ctx.Res.Header().Set("Content-Type", contentType)
|
ctx.Res.Header().Set("Content-Type", contentType)
|
||||||
if !isTextFile {
|
if !isTextFile && !isImageFile {
|
||||||
ctx.Res.Header().Set("Content-Disposition", "attachment; filename="+filepath.Base(treename))
|
ctx.Res.Header().Set("Content-Disposition", "attachment; filename="+filepath.Base(treename))
|
||||||
ctx.Res.Header().Set("Content-Transfer-Encoding", "binary")
|
ctx.Res.Header().Set("Content-Transfer-Encoding", "binary")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue