Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: fix transfers when using download_url

Nick Craig-Wood957311f47927
diff --git a/backend/b2/b2.go b/backend/b2/b2.go
index 5698c672b..8b06ff8ed 100644
--- a/backend/b2/b2.go
+++ b/backend/b2/b2.go
@@ -1672,8 +1672,8 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
opts.RootURL = o.fs.opt.DownloadURL
}
- // Download by id if set otherwise by name
- if o.id != "" {
+ // Download by id if set and not using DownloadURL otherwise by name
+ if o.id != "" && o.fs.opt.DownloadURL == "" {
opts.Path += "/b2api/v1/b2_download_file_by_id?fileId=" + urlEncode(o.id)
} else {
bucket, bucketPath := o.split()