Closed DmitryBorodiy closed 1 year ago
How would this differ from System.IO and saving files? Essentials gives you the different storage path options in a nice xplat manner.
How would this differ from System.IO and saving files? Essentials gives you the different storage path options in a nice xplat manner.
This will work similarly to FilePicker, only it will not select files, but create and save.
This is should work like this.
FileSaver.Current.Properties.SuggestedFileName = "New file.txt";
var file = await FileSaver.SaveAndPickFileAsync(FileMode.ReadWrite);
if(file != null)
{
//Do something with FileStream...
}
@davidortinau Hi I think it's talking about a similar 'SaveFileDialog' from WPF
@davidortinau Hi I think it's talking about a similar 'SaveFileDialog' from WPF
Yes!
@davidortinau Hi I think it's talking about a similar 'SaveFileDialog' from WPF
Or FileSavePicker on UWP.
This issue has already been created. But I don't think it's possible
This issue has already been created. But I don't think it's possible
1386
Why?
FilePicker is implemented, but FileSaver not...
Creating own FileSaver dialog... It's slow and uncomfortable. But Xamarin.Essentials can resolve this problem if you add FileSaver API.
Can you provide an sample of an application where this feature is made? This is non-standard behavior. You can use Share or Launcher.
On ios, the user can choose to save to files. I just recently fixed this feature.
On android, the user can choose a file manager that supports file saving.
If you want to save media files, it's better to use something like this
Can you provide an sample of an application where this feature is made? This is non-standard behavior. You can use Share or Launcher.
On ios, the user can choose to save to files. I just recently fixed this feature.
On android, the user can choose a file manager that supports file saving.
If you want to save media files, it's better to use something like this
So, In my Xamarin.Forms app I implement my own FileSavePicker for UWP and Android but it's not cross-platform...
Why FilePicker can't save files?
FilePickers - it's standart comfortable logic for open and save files...
You may notice that many cross-platform applications support "Save As" function (Save File dialog) on macOS, Windows and Linux, but on mobile devices apps use an analog of Essentials.Launcher
or Essentials.Share
and save to Gallery/Photos functions for media files
But Android have DirectoryPicker and FilePicker intent... User can enter the file name in prompt dialog and select folder... The program can create and write file in this folder.
This is a Windows 10 Mobile user logic๐๐๐
And it's more comfortable if you want write text files too
For those that need it, FileSaver API. I also have helpers to share and use those files.
For those that need it, FileSaver API. I also have helpers to share and use those files.
Link is no longer valid.
Still not seeing a FileSave dialog anywhere. Isn't there something? Even if it's UWP specific, that's fine by me. If FilePicker exists, it's a very small change to make it a FileSaver as well. It's just returning a directory and a file name.
The FilePicker can only be used as a 'FileSaver' if the file already exists. But, you need to be able to specify a new file.
For those that need it, FileSaver API. I also have helpers to share and use those files.
Link is no longer valid.
Still not seeing a FileSave dialog anywhere. Isn't there something? Even if it's UWP specific, that's fine by me. If FilePicker exists, it's a very small change to make it a FileSaver as well. It's just returning a directory and a file name.
The FilePicker can only be used as a 'FileSaver' if the file already exists. But, you need to be able to specify a new file.
Here's the updated link
I think at this point it's safe to say that this won't be making it's way into Xamarin.Essentials anymore. Keep your eye on .NET MAUI for all new development! Thanks for all input and efforts here.
Also, this one is now available in the .NET MAUI Community Toolkit!
Hello, Microsoft end .NET Xamarin Community! So, FilePicker API is cool, but Xamarin Forms need a FileSaver API for save files. Please implement this in Xamarin.Essentials.
Thanks! Best wishes!