Rhys666
Programmer
- May 20, 2003
- 1,106
I have some file download functionality in an ASP.net web application I'm currently working on which works splendidly on my local machine in development (Win XP Pro - IIS 5.1), but functions very differently when running on the test web server (Win Server 2003 - IIS 6.0).
Basically I have a link that opens my download page and the querystring of the page identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring, identifies the template required then uses the HttpResponse object to amend the current HttpResponse to clear the page content, append appropriate content-disposition and content-type headers stream the file to the HttpResponse and basically create the file download dialogue.
On my local machine this works fine and the download dialogue correctly identifies the file name and type attempting to be downloaded. However, when this is ported to the Test web server the download dialogue asks if I want to save or open the Download.aspx page, not the xls file that should be targetted. To further confuse me, if you save this file, open it in a text editor, leave the encoded elements, (square blocks, hex etc.), and save this as an xls file from the text editor MS Excel opens the saved file correctly and it is in fact the file that was attempted to be downloaded.
I'm not an IIS expert so am grasping at straws a little here, but does anyone have any experience of this behaviour, could it be an unrecognised MIME type, anything reasonable considered at this point as it's getting very annoying![[mad] [mad] [mad]](/data/assets/smilies/mad.gif)
Cheers
Rhys
""Vampireware /n/, a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."
My Home
Basically I have a link that opens my download page and the querystring of the page identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring, identifies the template required then uses the HttpResponse object to amend the current HttpResponse to clear the page content, append appropriate content-disposition and content-type headers stream the file to the HttpResponse and basically create the file download dialogue.
On my local machine this works fine and the download dialogue correctly identifies the file name and type attempting to be downloaded. However, when this is ported to the Test web server the download dialogue asks if I want to save or open the Download.aspx page, not the xls file that should be targetted. To further confuse me, if you save this file, open it in a text editor, leave the encoded elements, (square blocks, hex etc.), and save this as an xls file from the text editor MS Excel opens the saved file correctly and it is in fact the file that was attempted to be downloaded.
I'm not an IIS expert so am grasping at straws a little here, but does anyone have any experience of this behaviour, could it be an unrecognised MIME type, anything reasonable considered at this point as it's getting very annoying
![[mad] [mad] [mad]](/data/assets/smilies/mad.gif)
Cheers
Rhys
""Vampireware /n/, a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."
My Home