Downloading Large Files

M

Michael C. Gates

I am trying to download large files from an ASP page. The
files are not in the web directory. When I do this, a 150
MB file takes about 20 seconds or so for the dialog box to
show up. Then I sometimes get error: "Unable to allocate
required memory" and "Not enough storage is available to
complete this operation".

My code is below. Can this handle 150 MB files? Or is
there a better way to do this?

Const adTypeBinary = 1
response.clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition","attachment;" & _
"filename=myfile.dat"

Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile "d:\myfile.dat"

Response.BinaryWrite objStream.Read

objStream.Close
Set objStream = Nothing

- - - - - -

Thanks much! Please also reply via email as I am not on
newsgroups all the time.

Regards,

Michael C. Gates
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top