-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
[Request]: Use the XFile.name
as the shared file name
#1548
Comments
I second to this. I am creating the file with |
Same here. Getting image from web without any file extension causes the share with .BIN |
Is there at least any workaround for this currently? |
same issue |
Any updates on this ? |
Same here, seems like the bug still isnt fixed |
Please fix this |
Any way to change the name using |
any updates? |
Same request from me, now Share.shareXFiles causes files to have uuid like file name |
Same problem here |
it would be better to use file instead of XFile.fromData, this way you can name the file and delete it after sharing to keep the temporary directory clean, here is a work around:
if it's an exported excel file:
|
Same here! And I don't like the idea of writing file into persistent storage then read from it...Why bother the round trip? BTW |
This comment was marked as off-topic.
This comment was marked as off-topic.
OK, I have removed that piece of the comment. With that said, I believe the Android implementation for In this case, if the shared file on Android is of extension When I got time, I will definitely open a PR to address this issue!
|
I see, this is reported here: dart-lang/mime#55 at least the PR is getting some movement, I have subscribed to updates. If anyone tries to do a Once |
Ah, I mean I came up with a workaround that respects the extension from user's filename and then fallback to the MIME way in case it fails. By the way, may I ask why was the filename discarded and UUID was used instead?Is it for collision prevention or ASCII-compliance because of some legacy issues that I am not aware of? |
I don't remember, sorry. Maybe the git log or the original pr have a clue. |
haha no worries! I am trying to digest #1188 to see if I can get the full picture of the original issue. But based on my test against a real android phone (namely |
Should be closed by #2713 pending to be released. Thanks a lot @LBYPatrick for the contribution! |
...Haha you are welcome! Though, I have noticed that our test cases for |
There is an issue with the raw data usage. The Cross file package doesn't return the name parameter when using 'XFile.fromData'. Because of that, this issue should be open. |
Agreed with @ibrahimtelman that raw data names do not work still |
Same issue here, name parameter is ignored when using 'XFile.fromData' |
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 theXFile
'sname
property.According to the XFile documentation,
name
is intended to be used for this exact scenario.Proposal
I propose that the function
Share.shareXFiles
utilizesXFile.name
for the file name, if available. If not available, then default to the path file name.The text was updated successfully, but these errors were encountered: