Skip to content

Commit

Permalink
Update upload.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakura-Byte committed Jan 3, 2025
1 parent c1d6345 commit f55ff30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/115/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ func (f *Fs) upload(ctx context.Context, in io.Reader, src fs.ObjectInfo, remote
}

// If file exceeds the maximum upload size, bail out immediately (same as original).
if size > maxUploadSize {
if size > int64(maxUploadSize) {
return nil, fmt.Errorf("file size exceeds the upload limit: %d > %d", size, int64(maxUploadSize))
}

Expand Down Expand Up @@ -740,7 +740,7 @@ func (f *Fs) upload(ctx context.Context, in io.Reader, src fs.ObjectInfo, remote
return o, fmt.Errorf("sample upload form error: %w", err)
}
return o, o.setMetaDataFromCallBack(callbackData)
} else if size < maxUploadSize {
} else if size < int64(maxUploadSize) {
// chunked/multipart upload
fs.Debugf(o, "Fallback to multipart upload: size=%d < maxUploadSize", size)
return f.doMultipartUpload(ctx, in, src, o, leaf, dirID, size, options...)
Expand Down

0 comments on commit f55ff30

Please sign in to comment.