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
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