1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 17:13:18 +00:00

drive: fix upload to existing file (#2032)

This fixes uploads to existing files for Google Drive introduced by #2007.
Instead of updating the old file a new "Untitled" file would be created
in the root folder.
This commit is contained in:
Fabian Möller
2018-01-30 14:37:06 +01:00
committed by GitHub
parent 29d428040c
commit cf6d522d2f
2 changed files with 4 additions and 5 deletions

View File

@@ -824,7 +824,7 @@ func (f *Fs) PutUnchecked(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOpt
}
} else {
// Upload the file in chunks
info, err = f.Upload(in, size, createInfo.MimeType, createInfo, remote)
info, err = f.Upload(in, size, createInfo.MimeType, "", createInfo, remote)
if err != nil {
return o, err
}
@@ -1503,7 +1503,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOptio
}
} else {
// Upload the file in chunks
info, err = o.fs.Upload(in, size, updateInfo.MimeType, updateInfo, o.remote)
info, err = o.fs.Upload(in, size, updateInfo.MimeType, o.id, updateInfo, o.remote)
if err != nil {
return err
}