From e919bab3eb4653eedb4b08fcb7e5cdd44b313f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E8=AF=9A?= <54197427+Zhoucheng133@users.noreply.github.com> Date: Fri, 15 May 2026 18:14:17 +0800 Subject: [PATCH] fix(upload): wrong progress callback parameter names in README (#3406) * Update progress callback parameter names in README Signed-off-by: zhoucheng * formatting Signed-off-by: zhoucheng * Fixed the misssing braces Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> Signed-off-by: zhoucheng * docs(readme): fix remaining destructuring syntax in examples Signed-off-by: zhoucheng --------- Signed-off-by: zhoucheng Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- plugins/upload/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/upload/README.md b/plugins/upload/README.md index 6211db762..dc3699abf 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -66,7 +66,8 @@ import { upload, HttpMethod } from '@tauri-apps/plugin-upload' upload( 'https://example.com/file-upload', './path/to/my/file.txt', - (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress + ({ progressTotal, total }) => + console.log(`Uploaded ${progressTotal} of ${total} bytes`), // a callback that will be called with the upload progress { 'Content-Type': 'text/plain' } // optional headers to send with the request ) @@ -74,7 +75,8 @@ upload( upload( 'https://example.com/file-upload', './path/to/my/file.txt', - (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), + ({ progressTotal, total }) => + console.log(`Uploaded ${progressTotal} of ${total} bytes`), { 'Content-Type': 'text/plain' }, HttpMethod.Put // Use HttpMethod enum - supports POST, PUT, PATCH ) @@ -86,7 +88,8 @@ import { download } from '@tauri-apps/plugin-upload' download( 'https://example.com/file-download-link', './path/to/save/my/file.txt', - (progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress + ({ progressTotal, total }) => + console.log(`Downloaded ${progressTotal} of ${total} bytes`), // a callback that will be called with the download progress { 'Content-Type': 'text/plain' } // optional headers to send with the request ) ```