G
Guoqi Zheng
Dear Sir,
I made a force download in ASP. For other types of file, everything works
ok. but for .txt, .html this kind of file. it always return an error, file
not found. can someone point out what I did wrong here?
The following is my script
strContentType = "application/octet-stream"
abcFile = "filename="&objRs("DocumentName")
response.AddHeader "Content-Disposition", abcFile
response.contenttype=strContentType
response.binarywrite getBinaryFile(FileName)
function getBinaryFile(fileSpec)
Dim adTypeBinary
adTypeBinary = 1
Dim oStream
set oStream = server.createobject("ADODB.Stream")
oStream.Open
oStream.Type = adTypeBinary
oStream.LoadFromFile fileSpec
getBinaryFile= oStream.read
set oStream=nothing
end function
--
Met vriendelijke groet,
Guoqi Zheng
Tel: +31 (0) 23 5343545
http://www.meetholland.com
I made a force download in ASP. For other types of file, everything works
ok. but for .txt, .html this kind of file. it always return an error, file
not found. can someone point out what I did wrong here?
The following is my script
strContentType = "application/octet-stream"
abcFile = "filename="&objRs("DocumentName")
response.AddHeader "Content-Disposition", abcFile
response.contenttype=strContentType
response.binarywrite getBinaryFile(FileName)
function getBinaryFile(fileSpec)
Dim adTypeBinary
adTypeBinary = 1
Dim oStream
set oStream = server.createobject("ADODB.Stream")
oStream.Open
oStream.Type = adTypeBinary
oStream.LoadFromFile fileSpec
getBinaryFile= oStream.read
set oStream=nothing
end function
--
Met vriendelijke groet,
Guoqi Zheng
Tel: +31 (0) 23 5343545
http://www.meetholland.com