feat: misc improvements about upload/copy/hash (#5045)

general: add createTime/updateTime support in webdav and some drivers
general: add hash support in some drivers
general: cross-storage rapid-upload support
general: enhance upload to avoid local temp file if possible
general: replace readseekcloser with File interface to speed upstream operations
feat(aliyun_open): same as above
feat(crypt): add hack for 139cloud

Close #4934 
Close #4819 

baidu_netdisk needs to improve the upload code to support rapid-upload
This commit is contained in:
Sean
2023-08-27 21:14:23 +08:00
committed by GitHub
parent 9b765ef696
commit a3748af772
77 changed files with 1731 additions and 615 deletions

View File

@ -113,7 +113,7 @@ func CreateNestedFile(path string) (*os.File, error) {
}
// CreateTempFile create temp file from io.ReadCloser, and seek to 0
func CreateTempFile(r io.ReadCloser, size int64) (*os.File, error) {
func CreateTempFile(r io.Reader, size int64) (*os.File, error) {
if f, ok := r.(*os.File); ok {
return f, nil
}
@ -171,3 +171,10 @@ func GetMimeType(name string) string {
}
return "application/octet-stream"
}
const (
KB = 1 << (10 * (iota + 1))
MB
GB
TB
)