i have a view with a list of files which is returned from the database.
each file is a href to my controller action:
<a href="/Attachment/DownloadFile/3667">New Text Document.txt</a>
public virtual FileResult DownloadFile(int id)
{
var result = _domainService.QueryAttachment(id);
return File(result.FileData, result.MimeType, result.FileName);
}
the 3667 is the id of the file stored in SQL.
how do i go about enabling the right click ‘save as’ that you see on other sites?
when i do, it just saves the html rather than fetching the file from controller.
it might not be possible via storing files in SQL.
thanks,
ah silly me.. it does allow for Save-As but only IE.
firefox has its own tricks