From 037340b1b5538510a93eb40c4a40cc58f7420d1a Mon Sep 17 00:00:00 2001 From: Erol Ozcan Date: Wed, 8 Jul 2026 17:58:13 +0300 Subject: [PATCH] zoho: fix large file overwrite creating a duplicate instead of replacing - fixes #9585 The /stream/upload endpoint's overwrite flag is the x-prefixed header x-override-name-exist, matching its siblings x-filename, x-parent_id and x-streammode. uploadLargeFile sent the un-prefixed override-name-exist, which the endpoint ignores, so overwriting a file of 10 MiB or larger created a renamed duplicate instead of updating the existing file. The small upload API passes the flag as a query parameter and is unaffected. --- backend/zoho/zoho.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/zoho/zoho.go b/backend/zoho/zoho.go index 28e0d6e13..453fde539 100644 --- a/backend/zoho/zoho.go +++ b/backend/zoho/zoho.go @@ -1175,11 +1175,13 @@ func (f *Fs) uploadLargeFile(ctx context.Context, name string, parent string, si ContentType: "application/octet-stream", Options: options, ExtraHeaders: map[string]string{ - "x-filename": url.QueryEscape(name), - "x-parent_id": parent, - "override-name-exist": "true", - "upload-id": uuid.New().String(), - "x-streammode": "1", + "x-filename": url.QueryEscape(name), + "x-parent_id": parent, + // Must carry the x- prefix; without it the stream endpoint ignores + // the flag and creates a duplicate instead of overwriting. + "x-override-name-exist": "true", + "upload-id": uuid.New().String(), + "x-streammode": "1", }, }