Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(115): enforce 20GB file size limit on uploadev (#7447 clo… #7453

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions drivers/115/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package _115

import (
"context"
"fmt"
"strings"
"sync"

Expand Down Expand Up @@ -122,10 +121,7 @@ func (d *Pan115) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
if err := d.WaitLimit(ctx); err != nil {
return err
}
if stream.GetSize() > utils.GB*20 { // TODO 由于官方分片上传接口失效,所以使用普通上传小于20GB的文件
return fmt.Errorf("unsupported file size: 20GB limit exceeded")
}
// 分片上传

var (
fastInfo *driver115.UploadInitResp
dirID = dstDir.GetID()
Expand Down Expand Up @@ -181,13 +177,11 @@ func (d *Pan115) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
}

// 闪传失败,上传
// if stream.GetSize() <= utils.KB{ // 文件大小小于1KB,改用普通模式上传
if stream.GetSize() <= utils.GB*20 { // TODO 由于官方分片上传接口失效,所以使用普通上传小于20GB的文件
if stream.GetSize() <= utils.KB { // 文件大小小于1KB,改用普通模式上传
return d.client.UploadByOSS(&fastInfo.UploadOSSParams, stream, dirID)
}
return driver115.ErrUnexpected
// 分片上传
// return d.UploadByMultipart(&fastInfo.UploadOSSParams, stream.GetSize(), stream, dirID)
return d.UploadByMultipart(&fastInfo.UploadOSSParams, stream.GetSize(), stream, dirID)
}

func (d *Pan115) OfflineList(ctx context.Context) ([]*driver115.OfflineTask, error) {
Expand Down
Loading