The only reason for this post is that maybe google will see this and index it, because this needs to be easier to find.

If you’re having a problem outputting an excel file from an SSL/HTTPS connection here’s how I solved it:

ExcelExport.asp ———————————————————————————-
Session(“ExcelDownload”) = “TRUE”
#include file=”Header.asp”
Response.ContentType = “application/vnd.ms-excel”
Response.Addheader “Content-Disposition”, “attachment;Filename=MarketingContactReport.xls”
‘ Code Goes here
————————————————————————————————————

Header.asp —————————————————————————————–
If Session(“ExcelDownload”) “TRUE” Then
‘ This is to fix the excel download for IE
Response.CacheControl = “no-cache”
Call Response.AddHeader(“Pragma”, “no-cache”)
End If
Session(“ExcelDownload”) = “”
‘header file stuff
————————————————————————————————————

Advertisements