"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
linkbox: fix upload error "user upload file not exist"
Nick Craig-Wood87a65ec6a5a5
diff --git a/backend/linkbox/linkbox.go b/backend/linkbox/linkbox.goindex fd849ef59..4537d657e 100644--- a/backend/linkbox/linkbox.go+++ b/backend/linkbox/linkbox.go@@ -617,16 +617,36 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, opcase 1:// upload file using link from first stepvar res *http.Response+ var location string- file := io.MultiReader(bytes.NewReader(first10mBytes), in)-+ // Check to see if we are being redirectedopts := &rest.Opts{- Method: "PUT",- RootURL: getFirstStepResult.Data.SignURL,- Options: options,- Body: file,- ContentLength: &size,+ Method: "HEAD",+ RootURL: getFirstStepResult.Data.SignURL,+ Options: options,+ NoRedirect: true,}+ err = o.fs.pacer.CallNoRetry(func() (bool, error) {+ res, err = o.fs.srv.Call(ctx, opts)+ return o.fs.shouldRetry(ctx, res, err)+ })+ if res != nil {+ location = res.Header.Get("Location")+ if location != "" {+ // set the URL to the new Location+ opts.RootURL = location+ err = nil+ }+ }+ if err != nil {+ return fmt.Errorf("head upload URL: %w", err)+ }++ file := io.MultiReader(bytes.NewReader(first10mBytes), in)++ opts.Method = "PUT"+ opts.Body = file+ opts.ContentLength = &sizeerr = o.fs.pacer.CallNoRetry(func() (bool, error) {res, err = o.fs.srv.Call(ctx, opts)