How to write and read files from .NET MAUI Blazor?

Viewed 964

I'm trying to write an audio file into a .NET MAUI Blazor on Windows, so I can play it via HTML Audio Element via https://0.0.0.0/... or such link.

How can I get the application local storage path that I can write to, which points to that url?

1 Answers

Here is the answer: .NET MAUI Documentation about Storage

You can use AppDataDirectory static property of the FileSystem class:

string path = FileSystem.AppDataDirectory;

Gets the location where app data can be stored.

Related