Re: sending HUGE file to client via Response.BinaryWrite

From: Zam (zam_at_parks.lv)
Date: 03/11/05


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



Relevant Pages

  • Re: DDR
    ... > return the RAM for a diffrent type if it does not work. ... >> the RAM you specify, on the same motherboard that the O/P has, and have ... >> Regards, ... >> Richard Urban ...
    (microsoft.public.windowsxp.general)
  • Re: aspnet_wp.exe (PID: 500) was recycled because memory consumpti
    ... Still iam getting the same problem. ... adding RAM to your machine ... >> Server Application Unavailable ... >> Regards, ...
    (microsoft.public.dotnet.framework)
  • Re: RAM fillup with EWF
    ... > I am using RAM based EWF - is there any way to monitor how large a portion ... > of unwritten data the EWF has put into my RAM. ... >> Best regards, ...
    (microsoft.public.windowsxp.embedded)
  • Re: wmpnetwk.exe and task manager I/O read bytes
    ... CPU time of 0:02.34 and only Kaspersky anti virus had a higher time. ... Currently I only have two AVI files totalling 1.5GB and no music files on ... Why is the I/O read bytes figure so high? ...
    (microsoft.public.windowsmedia.player)
  • Re: Question about increasing Memory
    ... My video program will use all the RAM I ... >> Regards, ... >> Richard Urban ...
    (microsoft.public.windowsxp.general)