question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] FileSaver on Mac - new GUID used for name instead of name provided

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

The Mac implementation of the FileSaver uses a GUID instead of the filename provided as a parameter when setting the suggested file name in the save dialog. The parameter is correctly used to set the file extension.

image

Expected Behavior

The filename provided as an argument should be used to set the suggested name in the save file dialog.

image

Steps To Reproduce

  1. Use a mac
  2. Invoke the FileSaver.SaveAsync(fileName, stream, cancellationToken) method
  3. Observe the “Save As:” parameter in the dialog that opens

Link to public reproduction project repository

https://github.com/RoryRoberts/maui-community-toolkit-filesaver-guid-bug

See: https://github.com/RoryRoberts/maui-community-toolkit-filesaver-guid-bug/blob/main/MauiApp1/Shared/MainLayout.razor#L16

Environment

- .NET MAUI CommunityToolkit: 5.0.0
- OS: macOS Ventura 13.0.1
- .NET MAUI: 7.0.100

Anything else?

Suspected relevant code: https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui.Core/Essentials/FileSaver/FileSaverImplementation.macios.cs#L23

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
VladislavAntonyukcommented, Mar 25, 2023

We use the same code on Mac and iOS, it is not released yet.

1reaction
VladislavAntonyukcommented, Mar 3, 2023

I wrote this code to make sure we don’t get duplicate file name in temp folder. I will take a look if we can write file without using temporary directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

CommunityToolkit.Maui.Storage.FileSaver on iOS strange
FileSaver in my app on iOS I get a strange user interaction. ... [BUG] FileSaver on Mac - new GUID used for name...
Read more >
saveAs doesn't work in Outlook Desktop Client · Issue #587
This library works well in all browsers including IE11 but refuses to download files in Outlook 2016 Desktop Client on Windows 10.
Read more >
Warning! Using SuperDuper to clone from a…
WARNING! USING SUPERDUPER TO CLONE FROM AN HDD TO AN SSD MIGHT SERIOUSLY DAMAGE THE HEALTH OF YOUR SSD! This is the new...
Read more >
Is there a method to generate a standard 128bit GUID ...
cocoa - Is there a method to generate a standard 128bit GUID (UUID) on the Mac? - Stack Overflow.
Read more >
.NET MAUI Community Toolkit 5.1.0: Lazy View and Keyboard ...
On the Apple Mac platform, the component would ignore the provided file name in the 'Save As' text box, using a random GUID...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found