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

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

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
}