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

onedrive: fix wrong upload endpoint and createDate #1716

Oliver Heyme645cf5ec0fa3
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index 9aacd9c27..4f9805f4d 100644
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -1098,9 +1098,10 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
func (o *Object) createUploadSession(modTime time.Time) (response *api.CreateUploadResponse, err error) {
opts := rest.Opts{
Method: "POST",
- Path: "/root:/" + rest.URLPathEscape(o.srvPath()) + ":/createUploadSession",
+ Path: "/root:/" + rest.URLPathEscape(o.srvPath()) + ":/upload.createSession",
}
createRequest := api.CreateUploadRequest{}
+ createRequest.Item.FileSystemInfo.CreatedDateTime = api.Timestamp(modTime)
createRequest.Item.FileSystemInfo.LastModifiedDateTime = api.Timestamp(modTime)
var resp *http.Response
err = o.fs.pacer.Call(func() (bool, error) {