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

ulozto: set Content-Length header if the file size is known.

IoT Maestro748c43d525c6
diff --git a/backend/ulozto/ulozto.go b/backend/ulozto/ulozto.go
index b5033107a..cf92de32a 100644
--- a/backend/ulozto/ulozto.go
+++ b/backend/ulozto/ulozto.go
@@ -346,6 +346,11 @@ func (f *Fs) uploadUnchecked(ctx context.Context, name, parentSlug string, info
MultipartFileName: encodedName,
Parameters: url.Values{},
}
+ if info.Size() > 0 {
+ size := info.Size()
+ opts.ContentLength = &size
+ }
+
var uploadResponse api.SendFilePayloadResponse
err = f.pacer.CallNoRetry(func() (bool, error) {