pdf render to asp.net web page results in static title

前端 未结 1 657
自闭症患者
自闭症患者 2021-01-22 09:23

having a slight issue where i am rendering a pdf (stored as a byte array) into an asp.net web page, using the code below:

Response.ClearContent();
Response.Appen         


        
1条回答
  •  无人及你
    2021-01-22 10:12

    Your headblock is being cleared by:

    Response.ClearContent();
    

    So even if you're setting it in ..., you're never sending that to the client.

    Given the content type is application/pdf the browser doesn't know how to render the title, so it renders the URL.

    Obscurity isn't a form of security, and if you're relying on the user not knowing the Url to prevent them from downloading the file again, you need to rethink. With a network inspection tool they'll easily be able to see which resources they're requesting, even if you do obfuscate the Url.

    0 讨论(0)
提交回复
热议问题