Link to home
Start Free TrialLog in
Avatar of rgvn
rgvn

asked on

IIS 6.0 HTTP Compression Problem

Hi    
    I have one ASP page (ExcelReport.asp) with Response.ContentType = "application/vnd.ms-excel" and Response.AddHeader "Content-Disposition", "filename=ExcelReport.xls" to export to excel.  The website is hosted on Win 2003 server win IIS 6.0.When the user opens this page it displays the filedownload dialog box with file name "ExcelReport.xls" and user can save it as an excel file.
     The problem is when the HTTP Compression for dynamic files (compress application files) is turned on, on IIS, the files name extension (.xls) is not coming while trying to download. It comes as ExcelReport.asp and on saving gets saved as .asp.      
     This issue happens with IE 5.5 (SP2). But works fine if the HTTP Compression for dynamic files is turned off. Is this an IIS issue with HTTP Compression?
Can any one help on this ?

Thanks in advance
RAG
Avatar of disentropy
disentropy

The IIS engine is most likely attempting to compress the file, but because you have no associated file compression in the metabase that is creating a "zipped" (or similarly compressed) file, it is returning the page as the name of the asp file (which is the default behavior). It's not an issue with compression in IIS; the file should be delivered using the file compression (and associated file extesion) you identify to IIS in the metabase to use as the compression.

See the following article for an indepth description of HTTP Compression in IIS to set this up:

http://dotnetjunkies.com/Article/16267D49-4C6E-4063-AB12-853761D31E66.dcik
Avatar of rgvn

ASKER

Hi
  Thank you very much for your reply.
   We already have the same link and followed the same when we setup the HTTP Compression on IIS. And we also have .xls extension added in the Metabase.xml as given below.

<IIsCompressionScheme      Location ="/LM/W3SVC/Filters/Compression/gzip"
            HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
            HcCreateFlags="1"
            HcDoDynamicCompression="TRUE"
            HcDoOnDemandCompression="TRUE"
            HcDoStaticCompression="TRUE"
            HcDynamicCompressionLevel="0"
            HcFileExtensions="htm
                  html
                  txt"
            HcOnDemandCompLevel="10"
            HcPriority="1"
            HcScriptFileExtensions="asp
                  dll
                  exe
                  xls"
      >
</IIsCompressionScheme>
Also we have the web service extension added for the HTTP Compression.
Could you please correct, if there is something wrong in the metabse.xml ?

Thanks
RAG
No, nothing wrong in the metabase.xml. We tested it out here and it looks like when compression is enabled it ignores the filename of the Content Type that is declared and automatically returns the document as the name of the called page.
Avatar of rgvn

ASKER

Hi
   Thank you very much for your confirmation on metabase.xml. So we can consider this as a problem with HTTP Compression (IIS 6.0).
   Is there any solution for this ? Is it documented somewhere by microsoft ?

Thanks
RAG
ASKER CERTIFIED SOLUTION
Avatar of disentropy
disentropy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of giltjr
Are you using SSL by chance?  Not sure if it is related, but I have seen in IE where the file name used for downloads is different based on using SSL or non-SSL.  I know that it is IE and not the web servers, because we have SSL offload engines and so the web servers don't even know that SSL is invloved.
Not using SSL.
If you haven't done this already, you may want to get a packet capture utility and caputer the data stream.  One with compression and one with out and see what the difference is between the two.

One other thing you may want to try is to change the order of the file extentions.  Try:

HcScriptFileExtensions="xls
              asp
               dll
               exe"

and then:

HcScriptFileExtensions="dll
             xls
              asp
               exe"

Could be that IIS is replacing the file extentions with whatever is first in the list.  Which of course would need to be fixed by MS.
Avatar of rgvn

ASKER

I tried the same, but again the same results.

Thanks
RAG
Stupid question, why are you putting .xls in the HcScriptFileExtensions section?  Should this be in the HcFileExtension section?  In all of the examples for IIS 5.0 the only thing in HcScriptFileExtension are "executable" files, things like Excel, Word, PowerPoint documents are in the HcFileExtension.
Based on the following link xls should be in HcFileExtension, not HcScriptFileExtension because it is considered a static file and not a dynamic file:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/25d2170b-09c0-45fd-8da4-898cf9a7d568.mspx?mfr=true
Avatar of rgvn

ASKER

This was already tried by adding the .xls under HcFileExtension in the Metabase.xml. And gave the same results with IE 5.5 (SP2).

Thanks
RAG
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial