http://classicasp.aspfaq.com/general...mime-type.html
I have the below code borrowed from above to open a "save as.." filedownload
dialog box.
The dialog box will open and prompt me to save the right filename. Great!
Problem: the file is saved at 0 bytes. No content! No errors!
<%
Response.ContentType = "application/x-unknown" ' arbitrary
fn = (rsFileDownload.Fields.Item("FileNam").Value)
FPath = "http://www.mydomain.com" &
(rsFileDownload.Fields.Item("Folder").Value) & fn
Response.AddHeader "Content-Disposition","attachment; filename=" & fn
Set adoStream = CreateObject("ADODB.Stream")
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)
Response.BinaryWrite adoStream.Read()
adoStream.Close
Set adoStream = Nothing
Response.End
%>
So, to troubleshoot, I wrote these out...
<%=fn%><br>
<%=FPath%><br>
....then cut-n-pasted the full link in my browser address bar.
And everything downloaded fine.
So, the link is good.
What's going wrong here?
thanks