Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

big file download with ASP fails ...

Status
Not open for further replies.

RubenZ

Technical User
Sep 10, 2002
17
0
0
DE
Hi!


I want to use ASP to download big files using ADODB.STREAM. It works very fine with files smaller than 80 MB.
On the Webserver I can see that memory allocation and the process w3wp is running. After some time (more or less 2 minutes) I get a response timeout.

Here is the code:

Server.ScriptTimeout = 30000
Response.Buffer = True

Response.Clear
Response.Expires = 0
Response.ContentType = "Download-File"
Response.AddHeader "Content-Disposition","attachment; filename=" & sfile

Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Type = adTypeBinary
oStream.Open
oStream.LoadFromFile(sfile)
Response.AddHeader "Content-Length", oStream.Size ' -- Schönheit
Response.CharSet = "UTF-8"

For i = 0 To oStream.Size
i = i + 128000
Response.BinaryWrite(oStream.Read(128000))
Response.Flush

Next

oStream.Close
Set oStream = Nothing
Response.Flush
Response.End

Do I have to change something in my code - or perhaps a general setting in IIS / the metabase?

Many thanks in advance



Ruben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top