Skip to content

[bug] Bad file drop paths when path has spaces on Ubuntu #4034

@betamos

Description

@betamos

Describe the bug

The tauri://file-drop and tauri://file-drop-hover events contain paths which appear urlencoded. For example:

"/path/to/my file.ext" => "path/to/my%20file.ext"

I'm printing both from js and from the rust/tauri event loop, and the issues appears in both places. It does not appear on other platforms.

Reproduction

  1. Drop a file with spaces on Ubuntu (possibly all of linux).
  2. Check it's path.

Expected behavior

File paths have their original name.

To be pedantic, I think there's a long tail of non well-formed file paths, since some platforms allow all kinds of stuff (including 0x00 null bytes). I think as long as most common special chars are working, it's ok.

Platform and versions

Environment
  › OS: Ubuntu 20.04 X64
  › Node.js: 16.15.0
  › npm: 8.5.5
  › pnpm: Not installed!
  › yarn: 1.22.10
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.9
  › @tauri-apps/api [NPM]: 1.0.0-rc.4
  › tauri [RUST]: git+https://github.com/betamos/tauri?branch=betamos-head#9ef128453b35812c6a92d880826901e3055e9ac7 (1.0.0-rc.8),
  › tauri-build [RUST]: git+https://github.com/betamos/tauri?branch=betamos-head#9ef128453b35812c6a92d880826901e3055e9ac7 (1.0.0-rc.7),
  › tao [RUST]: 0.8.3,
  › wry [RUST]: 0.15.1,

App
  › build-type: bundle
  › CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  › distDir: ../ui/public
  › devPath: ../ui/public

App directory structure
  ├─ node_modules
  ├─ bin
  ├─ agent
  ├─ app
  ├─ .vscode
  ├─ src-svelte
  ├─ scripts
  ├─ ui
  └─ .git

Yes, tauri core is my own fork, which has a couple of unrelated changes. It was rolled to dev HEAD yesterday and it was a problem before that as well (I held off with the report until I had checked it's still an issue).



### Stack trace

_No response_

### Additional context

_No response_

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions