I have a problem with downloading files from my application. When I call a method DownloadVacationProposal
and returning the file nothing happens. Save/Open dialog in browser is not appearing.
This is my JavaScript code:
downloadVacationProposal: function () {
return $http({
method: "POST",
url: "Presence/DownloadVacationProposal",
});
}
and C# which I found here:
public FileResult DownloadVacationProposal()
{
string filePath = Server.MapPath("~/Files/proposal.doc");
string contentType = "application/msword";
return File(filePath, contentType, "proposal.doc");
}
I'm probably missing something, but I don't know what, so please help.
Thanks a lot.