Hi,
I have a downloads page that lists files located ina folder not in the webroot. I've found some code that streams the file to the browser however I want the user to be prompted to download the file, at the moment it is shown on-screen... zip files show up as loads of random text... not nice!
I've seen lots of posts on these forums but nothing that seems to help... can someone point me in the write direction?
My code is currently:
Cheers
I have a downloads page that lists files located ina folder not in the webroot. I've found some code that streams the file to the browser however I want the user to be prompted to download the file, at the moment it is shown on-screen... zip files show up as loads of random text... not nice!
I've seen lots of posts on these forums but nothing that seems to help... can someone point me in the write direction?
My code is currently:
Code:
strFilePath = server.mappath("../../database/" & Session("ORG") & "/") & "/" & Request("FN")
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
fn = Request("FN")
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition","attachment;filename=" & fn
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
Cheers