ASP.NET MVC FileContentResult customize download dialog?

I use FileContentResult to return a byte array created by the PDF system for viewing or loading by the user. It works great.

public FileContentResult ViewReport()
{
    HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + myFileName);

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

I would like to know if it is possible to hide the source in the download dialog?

i.e. Hide or remove the string "from" in the dialog box,

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

+3
source share
2 answers

This dialog is browser specific and you have no control from the website. The only thing that is configurable is the Content-DispositionHTTP header , which you can either download the file or open it in a line.

+3
source

, , , , , URL.

-1

Source: https://habr.com/ru/post/1772458/


All Articles