开发者

ASP.NET MVC FileContentResult customise download dialogue?

I'm using FileContentResult to return a byte array of a system generated PDF to the user to either view or download. This works perfectly.

public FileContentResult ViewReport()
{
    HttpContext.Response.AddHe开发者_如何转开发ader("content-disposition", "attachment; filename=" + myFileName);

    return File(myByteArray, "application/pdf");
}

What I'd like to know is - is it possible to hide the source in the download dialogue?

i.e. Hide or remove the "from" line in the dialogue,

http://i1216.photobucket.com/albums/dd364/nolana22/Download_Dialogue.png


This dialog is browser specific and you have no control from a web site. The only thing that's customizable is the Content-Disposition HTTP header which you allows you to either download the file or open it inline.


Pretty sure that is something the browser handles, unless you wanted to muck around with the headers being sent back and forth to eliminate your URL.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜