Within my MAUI Blazor hybrid project, I have a button that downloads an Excel file. Is it possible to open this Excel file? It is placed in the downloads folder.
How to get the path for downloads folder on multiple devices? Each username is different.
private async Task TableToExcel()
{
await JS.InvokeAsync<string>("tableToExcel", "tablename", "name", "excelfile.xls");
}
It is not possible for Javascript (or Webassembly, etc.) to force a modern browser to open a file upon download. Blazor Hybrid apps use
WebView2which is essentially Microsoft Edge, so you're sandboxed the same way you would be if you were making a web app. The best you can do is provide appropriate prompts to your users.