esastincy
esastincy

Reputation: 1627

IE adding http header PRAGMA: no-cache

I am currently developing a site using SSL that requires users to be able to upload files of different types (such as excel or word files) and then each item will be added to a grid. The user can then "click" on the the item in the grid and the item they uploaded would be displayed. The problem I am running into is with Internet Explorer adding the Pragma: "no-cache" header to the response which is blocking the user from viewing/saving the file if it is a file that has a content type with "application/~". When I try to do something like

Response.Headers.Remove("Pragma");

I get this error: This operation requires IIS integrated pipeline mode. Can anyone help me understand what is causing this and what I need to do to work around it?

Upvotes: 1

Views: 4471

Answers (1)

rick schott
rick schott

Reputation: 20617

HttpResponse.Headers property:

The Headers property is only supported with the IIS 7.0 integrated pipeline mode and at least the .NET Framework 3.0. When you try to access the Headers property and either of these two conditions is not met, a PlatformNotSupportedException is thrown.

A solution from here: “This operation requires IIS integrated pipeline mode”

Response.AddHeader("Content-Disposition", "attachment; filename=enrollments.csv");
Response.AddHeader("Pragma", "public");

Upvotes: 1

Related Questions