tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!

Home Page:https://tauri.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[dialog][v2] - File size always 0

luis-cicada opened this issue · comments

Problem:

When using the dialog plugin in Tauri applications to select a file, the reported size of the selected file is always 0.

Description:

Currently, when using the dialog plugin's file picker functionality to select a file within a Tauri application, the returned file size is consistently reported as 0 bytes, regardless of the actual size of the file selected by the user. This issue affects applications that rely on accurate file size information for processing or displaying selected files.

Expected Behavior:

The dialog plugin should accurately report the size of selected files, providing the correct file size in bytes to the Tauri application.

Steps to Reproduce:

  • Create a Tauri application.
  • Use the dialog plugin to implement a file picker dialog.
  • Select a file using the file picker dialog.
  • Retrieve and log the size of the selected file.
  • Notice that the reported size is always 0 bytes.

Environment:

Operating System: macOS/Windows 11
Tauri Version: v2.0.0-beta.11
Plugin Version: v2.0.0-beta.3

Additional Information:

This issue significantly impacts applications that rely on accurate file size information for their functionality. It affects usability and may lead to incorrect behavior or unexpected results in applications where file size is an essential factor.

Fix Proposal:
The issue seems to stem from how the dialog plugin handles file selection and retrieval of file metadata. A potential fix would involve updating the plugin to correctly fetch and provide file size information to the Tauri application when selecting files.

Linked Pull Request:
This issue is addressed by PR #1295, which proposes a fix to accurately report file size when using the dialog plugin.