drive: fix server side copy of big files

Before this change rclone was sending a MimeType in the requests for
server side Move and Copy.

The conjecture is that if you attempt to set the MimeType to something
different in a Copy then Google Drive has to do an actual copy of the
file data.  This takes a very long time (since it is large) and fails
after a 90s timeout.

After the change we no longer set the MimeType in Move or Copy and the
copies happen instantly and correctly.

Many thanks to @darthShadow for discovering that this was causing the
problem.

Fixes #3070
Fixes #3033
Fixes #3300
Fixes #3155
This commit is contained in:
Nick Craig-Wood 2019-07-04 08:13:27 +01:00
parent c9f77719e4
commit 5433021e8b
1 changed files with 2 additions and 1 deletions

View File

@ -1649,7 +1649,6 @@ func (f *Fs) createFileInfo(ctx context.Context, remote string, modTime time.Tim
Name: leaf,
Description: leaf,
Parents: []string{directoryID},
MimeType: fs.MimeTypeFromName(remote),
ModifiedTime: modTime.Format(timeFormatOut),
}
return createInfo, nil
@ -1713,6 +1712,8 @@ func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo,
}
if importMimeType != "" {
createInfo.MimeType = importMimeType
} else {
createInfo.MimeType = fs.MimeTypeFromName(remote)
}
var info *drive.File