incrediblezayed / file_saver

A simple flutter plugin for saving files in all platforms
https://pub.dev/packages/file_saver
BSD 3-Clause "New" or "Revised" License
75 stars 103 forks source link

On Windows, saving files with filenames that have disallowed characters silently fail #113

Open livtanong opened 6 months ago

livtanong commented 6 months ago

I haven't tried on other platforms, but I'm using Windows, and this is the behavior.

When I try to saveAs a file with a filename with a colon (I was trying to use a datetime plus some other things) it was just failing silently with null. I did some research and found that colons are disallowed.

I think one good option is for FileSaver to throw an exception. (Perhaps an InvalidFileNameException)

Alternatively, the dialog can still open with the illegal characters, and windows itself will complain when you press the save button (I have tried this and it does complain)

incrediblezayed commented 5 months ago

Oh I see, will add this in the next version, thanks @livtanong