Feat: put / get file in qiniu policy

This commit is contained in:
HFO4
2020-01-15 16:03:23 +08:00
parent 7fbbcefc57
commit 90f82100cf
8 changed files with 158 additions and 92 deletions

View File

@@ -76,6 +76,12 @@ func (handler Handler) Get(ctx context.Context, path string) (response.RSCloser,
}
resp.SetFirstFakeChunk()
// 尝试获取文件大小
if file, ok := ctx.Value(fsctx.FileModelCtx).(model.File); ok {
resp.SetContentLength(int64(file.Size))
}
return resp, nil
}