Feat: support apply append mode and overwrite mode for FileStream

This commit is contained in:
HFO4
2022-02-28 17:49:00 +08:00
parent 285611baf7
commit 118d738797
16 changed files with 32 additions and 41 deletions

View File

@@ -173,9 +173,9 @@ func (handler Driver) Put(ctx context.Context, file fsctx.FileHeader) error {
fileName := url.QueryEscape(path.Base(fileInfo.SavePath))
// 决定是否要禁用文件覆盖
overwrite := "true"
if fileInfo.Mode != fsctx.Create {
overwrite = "false"
overwrite := "false"
if fileInfo.Mode&fsctx.Overwrite == fsctx.Overwrite {
overwrite = "true"
}
// 上传文件