Jquery request download/open file to the user
- by CoffeeCode
I have a Url that returns a file. How should my jquery request looklike to download this file to the user??
the action method looks like this
public FileContentResult GetFile(int Id)
{
if (Id == 0)
return File(new byte[0], "");
Survey survey = Repository.GetItem(Id);
return File(survey.File.FileContent.ToArray(), survey.File.ContentType, survey.File.Name);
}