Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp force download

Reply
Thread Tools

asp force download

 
 
Guoqi Zheng
Guest
Posts: n/a
 
      01-14-2004
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


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      01-14-2004

"Guoqi Zheng" <> wrote in message
news:...
> 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?
>


What error? And I think you should be returning those file types as
"adTypeText" (2).

Ray at home


 
Reply With Quote
 
 
 
 
Guoqi Zheng
Guest
Posts: n/a
 
      01-14-2004
The error I got is "page not found", I don't really understand it. I will
try to test by adTypeText
Thanks

"Ray at <%=sLocation%>" <myFirstNameATlane34dotKOMM> wrote in message
news:#...
>
> "Guoqi Zheng" <> wrote in message
> news:...
> > 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?
> >

>
> What error? And I think you should be returning those file types as
> "adTypeText" (2).
>
> Ray at home
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nike air force one, air force 1, air force one low cut, air force one salewholeta@163.com Digital Photography 3 12-31-2008 04:29 PM
Nike Air Force Ones,Air Force One Air Force One-1 lky52193@gmail.com Computer Support 0 01-17-2008 04:40 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:46 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:34 PM
ASP Force Download of file from webserver JP SIngh ASP General 2 06-30-2005 06:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57