Skip to content

[Request]: Use the XFile.name as the shared file name #1548

@josephelliot-wk

Description

@josephelliot-wk

Plugin

share_plus

Use case

Our app lets users open files (usually PDFs), and some of these files have special characters that don't play nicely with temp-file paths.

For example, My First / Last File.pdf causes an error when writing to temp storage.

To combat this, you need to sanitize the file name to play nicely with the native file system. But, when share_plus shares this file (via Share.shareXFiles), it uses the file name from the path instead of the XFile's name property.

According to the XFile documentation, name is intended to be used for this exact scenario.

Proposal

I propose that the function Share.shareXFiles utilizes XFile.name for the file name, if available. If not available, then default to the path file name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions