D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Exporting Excel over HTTPS - Looking for Help

Tuesday, July 31, 2007 10:12 AM

I'm running into an issue trying to export a file from an ASP.NET page. When trying to export the Excel file (which is created in-code and returned in the response of the page), it works fine in HTTP...but as soon as I add an 'S' to the end, things go wonky:

- It tries to download Default_aspx instead of the Excel file

We monkeyed around a bit with some different code altering the Cache values and tried to see if we could set anything in IIS directly, which now has us at this:

- When you try to download the file, it starts downloading but then says that it can't locate the file...which it still tries to get Default.aspx (dot this time, not underscore like the issue above).

So anyway, does anyone have any success in getting exporting of a file to work properly from IIS and running under HTTPS?

D




Feedback

# re: Exporting Excel over HTTPS - Looking for Help

Hello,

I don't know how much this will help you, but are you passing the browser a link to the file or are you actually reading the file and passing the content?

Because if it is the latter, the default header is the "HTTP/1.1" and then the "Content-type: application/ms-excel"

Your best bet is to create your own headers which actually specify HTTPS/1.1 or just give them a session link to the file.

Hope that helps 7/31/2007 10:41 AM | David

# re: Exporting Excel over HTTPS - Looking for Help

Try using a generic httphandler. Look at the code here: http://weblogs.asp.net/lduveau/archive/2007/03/23/httphandler-and-save-as-prompt.aspx. The example uses an already existing file but with you can create a file in a memory stream and write it out to the browser. You call the handler like you would in a standard tag, just make the attribute target="_blank". Using an ASPX page to do this is so classic ASP ;P 7/31/2007 12:15 PM | William

# re: Exporting Excel over HTTPS - Looking for Help

I have never done this over SSL but for forcing a file download to the client that seems to work quite well can be found on my blog here: http://blogs.solidhouse.com/david.woods/PermaLink,guid,5233b827-6be2-47ec-9411-b7143c3db5ea.aspx

Hope that helps! 8/2/2007 2:11 AM | Dave Woods

# re: Exporting Excel over HTTPS - Looking for Help

Did you find a solution to this problem? If you're setting the content-type, I don't see how this could happen unless you're just using a bogus browser. 8/3/2007 7:00 AM | Lance

# re: Exporting Excel over HTTPS - Looking for Help

Hey guys,

Just an update for you: we did get it working. It turned out to be something to do with the certificate that was on the server.

Thanks for all the suggestions!

D 8/4/2007 2:50 PM | D'Arcy from Winnipeg

# re: Exporting Excel over HTTPS - Looking for Help

i use to know that when i was in college anyway you can look the web for how to make it. 4/16/2008 10:15 AM | miami

# re: Exporting Excel over HTTPS - Looking for Help

I had the same problem. I solved it through a solution metioned on http://www.telerik.com/community/forums/thread/b311D-chgmb.aspx

I had 2 lines of asp code:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"

After I cleared these 2 lines, my problem was solved! 9/1/2008 8:20 AM | Christiaan Westerbeek

# re: Exporting Excel over HTTPS - Looking for Help

hi i have the same problem in exporting through https. i'm using PHP and i used excel_spreadsheet_writer code to execute the export. it works fine in http but not in https. i'm running out of ideas how to fix this. pls help 11/27/2008 6:05 PM | raymanexe

# re: Exporting Excel over HTTPS - Looking for Help

What about selecting the "Do not save encrypted pages to disk" option in internet explorer's internet options. 4/30/2009 6:38 PM | Usman

# re: Exporting Excel over HTTPS - Looking for Help

hello,

I have same problem. My ASP.NET application is hosted on SSL enabled web site on IIS. Excel file is not exported with HTTPS if I use internet explorer. On the other hand, Mozilla firefox has no issue.

D'Arcy from Winnipeg sugguested some SSL setting on the server as said:

"Hey guys,

Just an update for you: we did get it working. It turned out to be something to do with the certificate that was on the server.

Thanks for all the suggestions!"

Please I require your help.

Thanks,
Faizan 11/2/2009 9:41 AM | faizan

# re: Exporting Excel over HTTPS - Looking for Help

HttpContext.Current.Response.AddHeader("Cache-Control", "")
11/4/2009 5:23 AM | Hridya

# re: Exporting Excel over HTTPS - Looking for Help



Hi friends,

I don't know how much this will help you,

nyway try this code

HttpContext.Current.Response.AddHeader("Cache-Control", "");

Thanks 11/4/2009 5:26 AM | Hridya

# re: Exporting Excel over HTTPS - Looking for Help

D'Arcy from Winnipeg sugguested some SSL setting on the server as said:

"Hey guys,

Just an update for you: we did get it working. It turned out to be something to do with the certificate that was on the server.

Thanks for all the suggestions!"

Please,please It turned out to be something to do WHAT with the certificate that was on the server.

I require your help.

Thanks,
9/25/2012 12:41 AM | Maeva

# Cheapest Software To Buy Top Tips to Predict Future Results. Read the Budgeting Software Guide

Find Cheap Software With discount Apple Final Cut Pro X
Track Your Money All In One Place. Use Mint 100% Free - Sign Up Now! 1/9/2017 7:07 PM | buy cheap 3ds

Post a comment