Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Use xfile.name instead of p.basename(file.path) #13

Open
Curvel opened this issue Mar 8, 2021 · 1 comment
Open

RFC: Use xfile.name instead of p.basename(file.path) #13

Curvel opened this issue Mar 8, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Curvel
Copy link

Curvel commented Mar 8, 2021

Currently, if the metadata attribute filenameisn't set meta["filename"] = p.basename(file.path) is used defaulty.

This doesn't work with XFile in Flutter Web. Quote from the XFileBase class: Accessing the data contained in the picked file by its path is platform-dependant (and won't work on web). Therefore, I propose to use XFile.name instead.

It's not a big issue because one can simply use:

TusClient(
      endpoint,
      file,
      metadata: {
        "filename": file.name
      },
)

but it would be more intuitive when also building for web.

@jjmutumi
Copy link
Owner

jjmutumi commented Mar 8, 2021

Interesting point! I'll have look at implementing this. Also open to a pull request?

@jjmutumi jjmutumi added the enhancement New feature or request label Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants