A
Andrew Durstewitz
Hi!
I am working on a peice of code that will allow a user to download a
file located in the users folder. The file is NOT located inside the
HTTP PUB so I need to use the FSO to stream it to them. For some reason
the code finds the file but the download fails...
ERROR: Internet Explorer cannot download downloadpdf.asp?code=OR1EC1
from mirror.***.com
Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.
CODE:
Set objFile = objFSO.GetFile(strFileName)
Response.Clear()
Response.AddHeader "Content-Disposition", "attachment; filename=" &
objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
Response.CharSet = "UTF-8"
objStream.LoadFromFile(strFileName)
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing
Thanks,
Andrew J Durstewitz
* * * Sent via DevBuilder http://www.devbuilder.org * * *
Developer Resources for High End Developers.
I am working on a peice of code that will allow a user to download a
file located in the users folder. The file is NOT located inside the
HTTP PUB so I need to use the FSO to stream it to them. For some reason
the code finds the file but the download fails...
ERROR: Internet Explorer cannot download downloadpdf.asp?code=OR1EC1
from mirror.***.com
Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.
CODE:
Set objFile = objFSO.GetFile(strFileName)
Response.Clear()
Response.AddHeader "Content-Disposition", "attachment; filename=" &
objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
Response.CharSet = "UTF-8"
objStream.LoadFromFile(strFileName)
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing
Thanks,
Andrew J Durstewitz
* * * Sent via DevBuilder http://www.devbuilder.org * * *
Developer Resources for High End Developers.