"Prabhat" <not_a_mail@hotmail.com> wrote in message
news:%23LHWzR5bGHA.3504@TK2MSFTNGP04.phx.gbl...[color=blue]
> Hi Friends,
>
> I have code that will "BinaryWrite" a EXE file of 20mb to client using the
> ADO Stream. After the download the EXE file works fine without any[/color]
problem.[color=blue]
>
> When I verified the EXE that gets downloaded to client machine that EXE[/color]
has[color=blue]
> the below text added to the bottom:
> ---------------------------------------------
> <font face="Arial" size=2>.<p>Active Server Pages</font> <font[/color]
face="Arial"[color=blue]
> size=2>error 'ASP 0113'</font>.<p>.<font face="Arial" size=2>Script timed
> out</font>.<p>.<font face="Arial"
> size=2>/Roctek/ProcessDownload.asp</font>.<p>.<font face="Arial"[/color]
size=2>The[color=blue]
> maximum amount of time for a script to execute was exceeded. You can[/color]
change[color=blue]
> this limit by specifying a new value for the property Server.ScriptTimeout
> or by changing the value in the IIS administration tools..</font>
> ----------------------------------------------
>
> So I can see that it is a Script TimeOut Error. So can you please guide me
> where the problem is comming and how can I rectify this. (Including the[/color]
ASP[color=blue]
> code that BinaryWrite the file)
> ---------------------------------------------
> Function DownloadFile(strFilename)
> dim stFile
> Response.Buffer = True
> Response.Clear
>
> Set stFile = Server.CreateObject("ADODB.Stream")
> stFile.Open
> stFile.Type = 1 'Set as BINARY
>
> On Error Resume Next
>
> Set fso = Server.CreateObject("Scripting.FileSystemObject")
> if not fso.FileExists(strFilename) then
> Response.Write("<h1>Requested file does not exists! Please contact[/color]
Roctek[color=blue]
> Support.</h1><P>")
> Response.End
> end if
> Set fFile = fso.GetFile(strFilename)
> iFileLength = fFile.Size
>
> stFile.LoadFromFile(strFilename)
>
> Response.AddHeader "Content-Disposition", "attachment; filename=" &
> fFile.Name
> Response.AddHeader "Content-Length", iFileLength
> Response.Charset = "UTF-8"
> Response.ContentType = "application/octet-stream"
>
> Response.BinaryWrite stFile.Read
> Response.Flush
> Response.Buffer = False
> Response.Clear
>
> Set fso = Nothing
> Set fFile = Nothing
> stFile.Close
> Set stFile = Nothing
> End Function
> -----------------------------------------------------------
>
> I am using IIS 5 on Windows 2000 Server. Please guide me to solve the
> problem
>
> Thanks
> Prabhat
>[/color]
You should also consider this article.
http://www.aspfaq.com/show.asp?id=2161
The second approach that chunks the file down out the response would be
better for
a 20MB file especially on if deployed on IIS6.0.
Anthony.