This worked for me (I was running into the 4MB ceiling too) (Thanks to
Jason Withrow's contribution to ASP101
which helped me get started on downloading files)
Response.Buffer = True 'I didn't try "False"
Const BufSize = 2097152 '2MB "chunk"
Dim i
Dim objstream
Set objStream = Server.CreateOb ject("ADODB.Str eam")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadF romFile strFilePath
strFileType = lcase(Right(str FileName, 4))
' Feel Free to Add Your Own Content-Types Here
Select Case strFileType
Case ".doc"
ContentType = "applicatio n/msword"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
:
: 'other cases
:
Case Else
ContentType = "applicatio n/octet-stream"
End Select
Response.Charse t = "UTF-8"
Response.Conten tType = ContentType
i = 1
Response.Binary Write objStream.Read( BufSize)
Response.Flush
while not objstream.EOS
objstream.Posit ion = (BufSize * i)
Response.Binary Write objstream.Read( BufSize)
Response.flush
i = i + 1
wend
objStream.Close
Set objStream = Nothing
"cnote" <cn***@discussi ons.microsoft.c omwrote in message
news:B1******** *************** ***********@mic rosoft.com...
>I am trying to upload large images ( around 4 mb) from the server to show
on
the client. Currently I'm using an http handler to do it and breaking it
into chunks sending it 1 mb at a time. Sometimes I'm getting errors, like
the page won't load. Any solutions on how this is done right? Thanks for
your help.