Thanks WP,
I'm still getting use to this ASP Stuff. I did get it working without ADO Stream, I posted that at the bottom.
The ADO kept giving me errors when I tried reading it. I may be using the wrong functions I can't seem to find any examples that don't use loadFromFile. I saw one that did "WriteText" and "ReadText" I just used w3 schools to find the binary versions "Write/Read" and then included Response.BinaryWrite.
For learning purposes I'd still probably like to get this one working.
' Print out my file using ADO Stream
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Open()
oStream.Type = 1
oStream.Position = 0
oStream.Write(attachHandle("data")) ' Data contains the binary of the file
Response.ContentType = attachHandle("type") ' Content Type
Response.AddHeader "Content-Disposition:","attachment; filename=" & attachHandle("filename")&";"
Response.BinaryWrite oStream.Read() ' Gives me a 404 if this line is uncommented
oStream.Close
Set oStream = Nothing
The original one was probably just messing up because of the headers since this now works:
Response.ContentType = attachHandle("type")
Response.AddHeader "Content-Disposition:","attachment; filename=" & attachHandle("filename")&";"
Response.BinaryWrite attachHandle("data")The semicolon thing is weird. I know in PHP you don't "need" a semicolon for the last statement although I'd never not include it for any reason it just makes it cleaner. This seems to be the same case for headers since it's not outputting an error or anything. I'm not sure how it would though. Most examples don't include it, in my first post I just added it so it looked more uniform.