diff --git a/plugins/upload/README.md b/plugins/upload/README.md index b69c8eda..ce854b71 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -1,6 +1,7 @@ ![plugin-upload](banner.png) Upload files from disk to a remote server over HTTP. +Download files from a remote HTTP server to disk ## Install @@ -56,7 +57,18 @@ import { upload } from 'tauri-plugin-upload-api' upload( 'https://example.com/file-upload' './path/to/my/file.txt' - (progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`) // a callback that will be called with the upload progress + (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`) // a callback that will be called with the upload progress + { 'ContentType': 'text/plain' } // optional headers to send with the request +) +``` + +```javascript +import { download } from "tauri-plugin-upload-api"; + +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 { 'ContentType': 'text/plain' } // optional headers to send with the request ) ```