Securly download file inside browser with correct filename

前端 未结 5 2047
一向
一向 2020-12-09 23:46

I am doing some work on a web site that has a secure area which is available to users only after they have logged in. In this area there is a page with links to pdf document

5条回答
  •  孤城傲影
    2020-12-10 00:10

    No, what she is saying is it is not possible to specify the filename when 'Content-disposition:inline' is used. 'Filename' is only used when using 'Content-disposition:attachment', as in her first example. This results in the document being downloaded with the correct filename. However what this solution is trying achieve is a document rendered INLINE, which when downloaded from the browser uses the correct filename, instead of the script name.

    Is there any other way of specifying the filename when using 'inline' other than url rewriting? The page I have written to render docs takes a database ID, so rewriting would be more difficult I think (the filename would have to be queried from the database).

提交回复
热议问题