Files
tauri-plugins-workspace/plugins/upload
Decebal DobricaandLucas Nogueira 41b96be345 feat(http, upload): update reqwest to 0.13 (#3593)
* feat(http, upload): update reqwest to 0.13

`tauri-plugin-http` re-exports `reqwest`, so moving it is a breaking change and
belongs on v3 rather than v2 (#3462). `tauri-plugin-updater` already took 0.13
in #3213; these two follow the same shape.

`rustls-tls` maps to `reqwest/rustls-no-provider` plus `rustls` with `ring`,
and the provider is installed as the process default only when none is set yet,
exactly as the updater does. Without it `reqwest::Client::new()` has no crypto
provider to build with.

Features reqwest 0.13 removed are removed here rather than remapped silently:

- `native-tls-alpn`: ALPN is part of `native-tls` now.
- `rustls-tls-manual-roots`, `rustls-tls-webpki-roots`, `rustls-tls-native-roots`:
  certificate verification goes through the platform verifier.
- `trust-dns`: renamed `hickory-dns`.
- `macos-system-configuration`: superseded by `system-proxy`, which the default
  feature set already carries and which the deprecation note pointed at.

Verified with the CI commands for both packages: clippy --all-targets and
clippy --all-targets --all-features under -D warnings, cargo test (http 8,
upload 7 with --all-features), and cargo fmt --all --check.

* feat(http): drop the reqwest re-export

* chore(http): drop duplicate macos-system-configuration changelog entry

* remove .tauri

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-10-09 12:31:31 -03:00
..
2026-06-30 10:01:54 -03:00
2026-09-22 06:42:29 -03:00
2022-12-14 19:46:22 +01:00
2026-09-26 22:24:59 -03:00
2022-12-14 18:54:05 +01:00
2022-12-14 18:54:05 +01:00
2022-12-14 18:54:05 +01:00
2026-09-26 14:46:48 -03:00

plugin-upload

Upload files from disk to a remote server over HTTP. Download files from a remote HTTP server to disk.

Platform Supported
Linux ✓
Windows ✓
macOS ✓
Android ✓
iOS ✓

Install

This plugin requires a Rust version of at least 1.95

There are three general methods of installation that we can recommend.

  1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
  2. Pull sources directly from Github using git tags / revision hashes (most secure)
  3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)

Install the Core plugin by adding the following to your Cargo.toml file:

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-upload = "2.0.0"
# alternatively with Git:
tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add @tauri-apps/plugin-upload
# or
npm add @tauri-apps/plugin-upload
# or
yarn add @tauri-apps/plugin-upload

Usage

First you need to register the core plugin with Tauri:

src-tauri/src/lib.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_upload::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { upload, HttpMethod } from '@tauri-apps/plugin-upload'

// Upload with default POST method
upload(
  'https://example.com/file-upload',
  './path/to/my/file.txt',
  ({ progressTotal, total }) =>
    console.log(`Uploaded ${progressTotal} of ${total} bytes`), // a callback that will be called with the upload progress
  { headers: { 'Content-Type': 'text/plain' } } // optional headers to send with the request
)

// Upload with specific HTTP method
upload(
  'https://example.com/file-upload',
  './path/to/my/file.txt',
  ({ progressTotal, total }) =>
    console.log(`Uploaded ${progressTotal} of ${total} bytes`),
  {
    headers: { 'Content-Type': 'text/plain' },
    method: HttpMethod.Put // Use HttpMethod enum - supports POST, PUT, PATCH
  }
)
import { download } from '@tauri-apps/plugin-upload'

download(
  'https://example.com/file-download-link',
  './path/to/save/my/file.txt',
  ({ progressTotal, total }) =>
    console.log(`Downloaded ${progressTotal} of ${total} bytes`), // a callback that will be called with the download progress
  { headers: { 'Content-Type': 'text/plain' } } // optional headers to send with the request
)

Contributing

PRs accepted. Please make sure to read the Contributing Guide before making a pull request.

Partners

CrabNebula

For the complete list of sponsors please visit our website and Open Collective.

License

Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.

MIT or MIT/Apache 2.0 where applicable.