SaveAs Dialog for Asp.net Core

By Edward

I am implementing download Excel file from Asp.Net Core, the below code will download the file to local disk Downloads, I am wondering how to provide an UI for end user to select the position to store the downloaded file.

public FileResult downloadFile(string filePath)
{
    IFileProvider provider = new PhysicalFileProvider(filePath);
    IFileInfo fileInfo = provider.GetFileInfo(fileName);
    var readStream = fileInfo.CreateReadStream();
    var mimeType = "application/vnd.ms-excel";
    return File(readStream, mimeType, fileName);
}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273