Re: sending HUGE file to client via Response.BinaryWrite
From: Zam (zam_at_parks.lv)
Date: 03/11/05
- Next message: Jordan: "Need sample form that emails users input"
- Previous message: Jason Brown [MSFT]: "Re: Simple CheckBox Question"
- In reply to: Mark Schupp: "Re: sending HUGE file to client via Response.BinaryWrite"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 11 Mar 2005 04:22:38 +0200
Hello Mark,
Unfortunatly, the same negative result (eat all RAM and CPU time):
Error number: -2147024882
Error description: Not enough storage is available to complete this
operation.
Error line: adoStream.LoadFromFile(FPath)
With best regards,
"Mark Schupp" <nospan@nospam.com> wrote in message
news:Or3P6HcJFHA.3184@TK2MSFTNGP09.phx.gbl...
> Not familiar with streams so this is mostly a guess but you might try
making
> sure that the stream's "mode" is set to adModeRead (=1).
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "Zam" <zam@parks.lv> wrote in message
> news:eK54LTbJFHA.1860@TK2MSFTNGP15.phx.gbl...
> > Hello World,
> >
> > Under Windows 2003 Server. IIS6.
> >
> > The following code working fine for small files, and for files with size
> > about few megabytes.
> >
> > If I am trying to send HUGE file -- about 700 Megabyte -- w3wp.exe eat
all
> > memory (I have 1024 megabytes) and all CPU time without positive result.
> >
> > Question: how could i _clever_ and fast send very huge file to client,
> with
> > keeping "file location privacy" ?
> >
> > <%
> > Response.Buffer = False
> > Server.ScriptTimeout = 30000
> >
> > Response.ContentType = "application/x-unknown"
> > fn = "movie1.avi"
> > FPath = "g:\movies\" & fn
> > Response.AddHeader "Content-Disposition", "attachment; filename=" &
fn
> >
> > Set adoStream = CreateObject("ADODB.Stream")
> > chunk = 2048
> > adoStream.Open()
> > adoStream.Type = 1
> > adoStream.LoadFromFile(FPath)
> >
> > iSz = adoStream.Size
> >
> > Response.AddHeader "Content-Length", iSz
> >
> > For i = 1 To iSz \ chunk
> > If Not Response.IsClientConnected Then Exit For
> > Response.BinaryWrite adoStream.Read(chunk)
> > Next
> >
> > If iSz Mod chunk > 0 Then
> > If Response.IsClientConnected Then
> > Response.BinaryWrite objStream.Read(iSz Mod chunk)
> > End If
> > End If
> >
> > adoStream.Close
> > Set adoStream = Nothing
> >
> > Response.End
> > %>
> >
> > With best regards,
> >
> >
>
>
- Next message: Jordan: "Need sample form that emails users input"
- Previous message: Jason Brown [MSFT]: "Re: Simple CheckBox Question"
- In reply to: Mark Schupp: "Re: sending HUGE file to client via Response.BinaryWrite"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|