Content-Disposition:What are the differences between “inline” and “attachment”?

前端 未结 3 1248
孤街浪徒
孤街浪徒 2020-11-22 07:43

What are the differences between

Response.AddHeader(\"Content-Disposition\", \"attachment;filename=somefile.ext\")

and

Resp         


        
3条回答
  •  误落风尘
    2020-11-22 08:23

    It might also be worth mentioning that inline will try to open Office Documents (xls, doc etc) directly from the server, which might lead to a User Credentials Prompt.

    see this link:

    http://forums.asp.net/t/1885657.aspx/1?Access+the+SSRS+Report+in+excel+format+on+server

    somebody tried to deliver an Excel Report from SSRS via ASP.Net -> the user always got prompted to enter the credentials. After clicking cancel on the prompt it would be opened anyway...

    If the Content Disposition is marked as Attachment it will automatically be saved to the temp folder after clicking open and then opened in Excel from the local copy.

提交回复
热议问题