Response.WriteFile/TransmitFile fails when compress dynamic files turn on inIIS with SSL
August 26th, 2007 — ¥ong¥s
I come across error file not available when download file via response.writefile or transmitfile in asp.net. This error only happenned when you site on SSL. IIS 6 compression help me speed up all my applications. But the problem occur when some of my aspx page using response.writefile to download file. I get error file not found.
So I have to turn off the specific aspx page do not use IIS compression in order to make my download works. To configure that, it take me days to find out the solution. You can buy some 3rd party product to configure that. But that will not cheap. Here are the free ways to do it
1. First, to create a node for the page in the metabase in IIS manager. Right click on the file and go to properties. Make a change of some sort, apply, then change it back. Do an IISReset. This will create a IISWebFile node in MetaBase.xml
2. Try on this command “cscript C:\Inetpub\AdminScripts\adsutil.vbs set W3SVC/{siteID}/Root/{subfolder}/{page.aspx}/DoDynamicCompression False”
SiteID is a number represent your web application.
3. If you get error running this command, try to open MetaBase.xml and search the IISWebFile tag which represent “{subfolder}/{page.aspx}”. Then add in:
DoDynamicCompression=”FALSE”
Then, do an IISReset.
That’s all folks. Hope can help someone having the same problem