Hi,
Using Aspose.Cells v4.7.0.0 on a IIS 6.0 server. I just activated HTTP Compression and my Excel documents no longer download properly. I get the Excel error : “ cannot be accessed. The file may be corrupted, located on a server that is not responding, or read-only.”
I read this blog entry (http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/http-compression.html), but I think it does not describe my current problem for the following reasons :
- I’m using IE8, FF3.5, Chrome, not IE6. All experience the same problem.
- I’m already using the “OpenInExcel” option as mentionned in the solution.
With Aspose.Pdf files, it downloads without any problem. Both files are generated from an .ASPX page. Here are the response headers received for both requests :
HTTP/1.1 200 OK
Cache-Control: private
Date: Thu, 06 Aug 2009 19:53:37 GMT
Transfer-Encoding: chunked
Content-Type: application/pdf
Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=test01.pdf
Content-Encoding: gzip
Vary: Accept-Encoding
HTTP/1.1 200 OK
Cache-Control: private
Date: Thu, 06 Aug 2009 19:53:42 GMT
Transfer-Encoding: chunked
Content-Type: application/vnd.ms-excel
Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=test01.xls
Content-Encoding: gzip
Vary: Accept-Encoding
In IIS’s metabase.xml, I only activated compression for the following file extensions :
HcFileExtensions=“htm
html
txt
js
css”
HcScriptFileExtensions=“asp
dll
exe
aspx
asmx
ashx
axd”
Do you have any idea of what could cause the problem ?
One weird thing I did notice from time to time is that the SAME, exact same, file generated in UI culture en-US does not
work, but generated from UI culture ca-FR, it did.
Attached is a sample project reproducing the problem. I was not able to the get it to work in any culture.
Thanks a lot,
dstj.
Hi,
Please try the attached latest version/fix v4.7.1.22. Also, you may add a line after Workbook.Save() i.e..,
Response.End();
If you still find the problem, please remove all coding lines regarding Aspose.Cells API, load the file from the disk only with System.IO.FileStream, then export the file by Response object to check what has caused this error.
Thank you.
I’ll try, but you’re saying that you have no problem on your end with HTTP compression activated and my sample project ?
It does seem to fix the problem. Thanks. I noticed it is compiled in .NET 1.0.3705. Do you have the same fix compiled in .NET 2 or 3.5 ?
Hi,
Please try the attached version compiled on .NET2.0 for your need.
Thank you.