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

ftp: make upload error 250 indicate success

Nick Craig-Wood76ea716abfcc
diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go
index ab90c1e95..28db54430 100644
--- a/backend/ftp/ftp.go
+++ b/backend/ftp/ftp.go
@@ -1050,6 +1050,16 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
return errors.Wrap(err, "Update")
}
err = c.Stor(o.fs.opt.Enc.FromStandardPath(path), in)
+ // Ignore error 250 here - send by some servers
+ if err != nil {
+ switch errX := err.(type) {
+ case *textproto.Error:
+ switch errX.Code {
+ case ftp.StatusRequestedFileActionOK:
+ err = nil
+ }
+ }
+ }
if err != nil {
_ = c.Quit() // toss this connection to avoid sync errors
remove()