Connecting Tech Pros Worldwide Help | Site Map

Script timed out Message added to Binary File End

Prabhat
Guest
 
Posts: n/a
#1: May 4 '06
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 problem.

When I verified the EXE that gets downloaded to client machine that EXE has
the below text added to the bottom:
---------------------------------------------
<font face="Arial" size=2>.<p>Active Server Pages</font> <font face="Arial"
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" size=2>The
maximum amount of time for a script to execute was exceeded. You can change
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 ASP
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 Roctek
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


Bob Barrows [MVP]
Guest
 
Posts: n/a
#2: May 4 '06

re: Script timed out Message added to Binary File End


Prabhat wrote:[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 problem.
>
> When I verified the EXE that gets downloaded to client machine that
> EXE has the below text added to the bottom:
> ---------------------------------------------
> <font face="Arial" size=2>.<p>Active Server Pages</font> <font
> face="Arial" 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"
> size=2>The maximum amount of time for a script to execute was
> exceeded. You can change 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 ASP code that BinaryWrite the file)[/color]

Is something wrong with your google skills? Or your ability to search
www.aspfaq.com?

Add this to your page:
Server.ScriptTimeout =<whatever value it takes to eliminate the error>
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Prabhat
Guest
 
Posts: n/a
#3: May 4 '06

re: Script timed out Message added to Binary File End


[color=blue]
> Is something wrong with your google skills? Or your ability to search
> www.aspfaq.com?
>
> Add this to your page:
> Server.ScriptTimeout =<whatever value it takes to eliminate the error>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>[/color]
Hi Bob,

I am aware that we can use <% Server.ScriptTimeout = n %> but I wanted to
know is this the correct aproach to Solve???

But I am wondering that if there is some other way that I can do in my asp
code that stream the file. Also If I set the timeout in any procedure will
that timeout be local to procedure or global to application?

Thanks
Prabhat


Prabhat
Guest
 
Posts: n/a
#4: May 4 '06

re: Script timed out Message added to Binary File End


> Is something wrong with your google skills? Or your ability to search[color=blue]
> www.aspfaq.com?
>
> Add this to your page:
> Server.ScriptTimeout =<whatever value it takes to eliminate the error>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>[/color]
About Script Timeout I have seen the page:
http://www.aspfaq.com/show.asp?id=2066


Bob Barrows [MVP]
Guest
 
Posts: n/a
#5: May 4 '06

re: Script timed out Message added to Binary File End


Prabhat wrote:[color=blue][color=green]
>> Is something wrong with your google skills? Or your ability to search
>> www.aspfaq.com?
>>
>> Add this to your page:
>> Server.ScriptTimeout =<whatever value it takes to eliminate the
>> error>[/color][/color]
[color=blue]
> About Script Timeout I have seen the page:
> http://www.aspfaq.com/show.asp?id=2066[/color]

Well, that article's pretty clear about the scope of this property isn't it?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Bob Barrows [MVP]
Guest
 
Posts: n/a
#6: May 4 '06

re: Script timed out Message added to Binary File End


Prabhat wrote:[color=blue][color=green]
>> Is something wrong with your google skills? Or your ability to search
>> www.aspfaq.com?
>>
>> Add this to your page:
>> Server.ScriptTimeout =<whatever value it takes to eliminate the
>> error>
>>[/color]
> Hi Bob,
>
> I am aware that we can use <% Server.ScriptTimeout = n %>[/color]

:-)
OK, so my lack of mind-reading/clairvoyancy skills have been exposed ...
[color=blue]
> but I
> wanted to know is this the correct aproach to Solve???
>
> But I am wondering that if there is some other way that I can do in
> my asp code that stream the file.[/color]

Only if whatever you did had the result of reducing the time taken to
process the file. If that's what you're asking then there probably is not
anything you can do to affect this without a third-party component.
[color=blue]
> Also If I set the timeout in any
> procedure will that timeout be local to procedure or global to
> application?
>[/color]
As the article you cited states: the setting only has effect for the page in
which it is set.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Prabhat
Guest
 
Posts: n/a
#7: May 4 '06

re: Script timed out Message added to Binary File End


Hi Bob,

thanks for those info. I have to use the Server.ScriptTimeout for this to
around 1800 sec as the file size is 20 mb.

Thanks
Prabhat


Anthony Jones
Guest
 
Posts: n/a
#8: May 4 '06

re: Script timed out Message added to Binary File End



"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.


Prabhat
Guest
 
Posts: n/a
#9: May 5 '06

re: Script timed out Message added to Binary File End


[color=blue]
> 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.
>[/color]
Hi Anthony,

Thanks for the link. it is having good info. Also I liked the way it stream
the binary write in chunks using ther buffer = False.

Can I set the Buffer = False and send data without Chunks?

Thanks
Prabhat


Dave Anderson
Guest
 
Posts: n/a
#10: May 5 '06

re: Script timed out Message added to Binary File End


Prabhat wrote:[color=blue]
> Thanks for the link. it is having good info. Also I liked
> the way it stream the binary write in chunks using ther
> buffer = False.
>
> Can I set the Buffer = False and send data without Chunks?[/color]

Yes.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


Anthony Jones
Guest
 
Posts: n/a
#11: May 5 '06

re: Script timed out Message added to Binary File End



"Prabhat" <not_a_mail@hotmail.com> wrote in message
news:OSTIfrDcGHA.1324@TK2MSFTNGP04.phx.gbl...[color=blue]
>[color=green]
> > 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.
> >[/color]
> Hi Anthony,
>
> Thanks for the link. it is having good info. Also I liked the way it[/color]
stream[color=blue]
> the binary write in chunks using ther buffer = False.
>
> Can I set the Buffer = False and send data without Chunks?
>[/color]

You can but it doesn't make any difference from having Buffer = True and
doing a single large binarywrite.

Rather than thinking of Buffer = false meaning 'don't buffer' think of it
more as 'flush buffer after each write or binarywrite'.

On IIS6 the default buffer limit is 4MB. Even with Buffer = False if you
attempt to write your 20MB file in single call to binarywrite you will
exceed the buffer limit and get an error.

Anthony.


Prabhat
Guest
 
Posts: n/a
#12: May 5 '06

re: Script timed out Message added to Binary File End



"Anthony Jones" wrote[color=blue]
>
> You can but it doesn't make any difference from having Buffer = True and
> doing a single large binarywrite.
>
> Rather than thinking of Buffer = false meaning 'don't buffer' think of it
> more as 'flush buffer after each write or binarywrite'.
>
> On IIS6 the default buffer limit is 4MB. Even with Buffer = False if you
> attempt to write your 20MB file in single call to binarywrite you will
> exceed the buffer limit and get an error.
>
> Anthony.
>[/color]
Hi Anthony,

you are correct in concept. So now I think :
Buffer = False and BinaryWrite with Chunks is better approach.

Thanks
Prabhat



Dave Anderson
Guest
 
Posts: n/a
#13: May 5 '06

re: Script timed out Message added to Binary File End


Prabhat wrote:[color=blue]
> you are correct in concept. So now I think :
> Buffer = False and BinaryWrite with Chunks is better approach.[/color]

Or just leave the buffer alone and Response.Flush() periodically:
http://msdn.microsoft.com/library/en...e01af7e6cb.asp


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


malcolm
Guest
 
Posts: n/a
#14: May 6 '06

re: Script timed out Message added to Binary File End



Bank Charges Refunded


Free help to recover your bank or credit card charges from
www.bankchargesrefunded.co.uk



Its your money and its better in your pocket!



On The 5th April 2006 The OFT (The Office of Fair Trading) set a threshold
for intervention @ 12. Find out what the OFTs statement means to you, your
bank & the bank charges that they impose on you.



It's time to take Action Against Bank Charges!



Extract from the OFT's action on credit card default charges 5 April 2006.



"We consider that a contract term is likely to be unfair if it
requires consumers to pay more as a result of a default than the court would
order them to pay if they were sued for breach of contract"



Read the full report inside. © Crown copyright 2006



The Banks Damage Limitation Exercise. It is common practice for a bank to
offer only half of the money claimed or even less than half! in some cases.
Do not accept less than the full amount. The bank charges are illegal,
unfair and a penalty against you as a consumer.



Bank Charges Refunded. We help you to receive a full refund for all bank
charges going back 6 years. Its all on the site.


Closed Thread