Feat: use goroutine to detect upload-canceling action / Object name validate

This commit is contained in:
HFO4 committed 2019-11-18 13:26:32 +08:00
1 parent 331931e539
commit 160f964564
6 files changed
+54 -1

No files matched your search

+2
View File
@@ -24,12 +24,14 @@ func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string)
}
}
// 创建目标文件
out, err := os.Create(dst)
if err != nil {
return err
}
defer out.Close()
// 写入文件内容
_, err = io.Copy(out, file)
return err
}