I have a function in the controller that downloads a configurations:
public FileStreamResult SaveData()
{
var toJson = JsonConvert.SerializeObject(this.GetData());
var byteArray = System.Text.Encoding.ASCII.GetBytes(toJson);
var stream = new MemoryStream(byteArray);
string fileName = "Configuration.json";
this.GetData().Save = false;
return new FileStreamResult(stream, "text/html")
{
FileDownloadName = fName
};
}
It works fine, but the only issue is that it downloads file automatically. I want to provide a user with a possibility to update the name and set the download location, i.e. I want a "save as" dialog to popup prior to download.
I looked multiple sources, but cannot find something, which will be applicable. Can anyone suggest, how it should be done?
Thanks in advance.