download office 07/10 files from classic ASP script

Gjertcimmc

New Member
Hi I am trying to fix a ASP script when we moved our IIS server from 6 to 7.5 and from windows Server 2003 to 2008... I had to make a few changes to the script to get it reworking like supressing the content length as this prevented all files from downloading.How I download these files is via an ASP download page which runs as a script, however this does not work for the newer docx, pptx files, but works for doc, pdf and but funniliy for XLSX for some reason.When download the docx and pptx files, I get a FSO prompt box, save it, but I download the files of zero bytes. All previous types still work OK. But, if I download the docx and pptx directly from the address bar instead of the download page, it works without problems.....I checked the MIME types in IIS 7 and the PPTX and DOCX appear to be there.Here is the script that I use:\[code\] Set oFso = Server.CreateObject("Scripting.FileSystemObject") If oFso.FileExists(strAbsFile) Then Set oFile = oFso.GetFile(strAbsFile) Response.Clear Response.AddHeader "Content-Disposition", "attachment; filename=" & oFile.Name Response.ContentType = "application/octet-stream" Set oStream = Server.CreateObject("ADODB.Stream") oStream.Open oStream.Type = 1 Response.CharSet = "UTF-8" oStream.LoadFromFile(strAbsFile) Response.BinaryWrite(oStream.Read) oStream.Close Set oStream = Nothing Set oFile = NothingEnd If\[/code\]What am I doing wrong to prevent download of the DOCX and PPTX files, and how do I fix it to make it work?
 
Top