From 99788b605edf499e0f60d28f51c79d01f4eb6ad5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 27 Jun 2023 17:08:37 +0100 Subject: [PATCH] sharefile: disable streamed transfers as they no longer work At some point the sharefile API changed to require the size of the file in the initial transaction which makes the streaming upload fail with this error: upload failed: file size does not match (-2) This was discovered by the integration tests. --- backend/sharefile/sharefile.go | 21 +++++++++++++-------- docs/content/overview.md | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/backend/sharefile/sharefile.go b/backend/sharefile/sharefile.go index 11bbefa6a..f7cf4c87a 100644 --- a/backend/sharefile/sharefile.go +++ b/backend/sharefile/sharefile.go @@ -775,8 +775,13 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . } } -// PutStream uploads to the remote path with the modTime given of indeterminate size -func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { +// FIXMEPutStream uploads to the remote path with the modTime given of indeterminate size +// +// PutStream no longer appears to work - the streamed uploads need the +// size specified at the start otherwise we get this error: +// +// upload failed: file size does not match (-2) +func (f *Fs) FIXMEPutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { return f.Put(ctx, in, src, options...) } @@ -1453,12 +1458,12 @@ func (o *Object) ID() string { // Check the interfaces are satisfied var ( - _ fs.Fs = (*Fs)(nil) - _ fs.Purger = (*Fs)(nil) - _ fs.Mover = (*Fs)(nil) - _ fs.DirMover = (*Fs)(nil) - _ fs.Copier = (*Fs)(nil) - _ fs.PutStreamer = (*Fs)(nil) + _ fs.Fs = (*Fs)(nil) + _ fs.Purger = (*Fs)(nil) + _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) + _ fs.Copier = (*Fs)(nil) + // _ fs.PutStreamer = (*Fs)(nil) _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) diff --git a/docs/content/overview.md b/docs/content/overview.md index 5babe96c8..8057a1a26 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -473,7 +473,7 @@ upon backend-specific capabilities. | Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | | Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | | Box | Yes | Yes | Yes | Yes | Yes ‡‡ | No | Yes | Yes | Yes | Yes | -| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | Yes | No | No | Yes | +| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | | Dropbox | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | Yes | | Enterprise File Fabric | Yes | Yes | Yes | Yes | Yes | No | No | No | No | Yes | | FTP | No | No | Yes | Yes | No | No | Yes | No | No | Yes |