Script timed out Message added to Binary File End

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prabhat

    Script timed out Message added to Binary File End

    Hi Friends,

    I have code that will "BinaryWrit e" 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>Acti ve 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.ScriptTi meout
    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(st rFilename)
    dim stFile
    Response.Buffer = True
    Response.Clear

    Set stFile = Server.CreateOb ject("ADODB.Str eam")
    stFile.Open
    stFile.Type = 1 'Set as BINARY

    On Error Resume Next

    Set fso = Server.CreateOb ject("Scripting .FileSystemObje ct")
    if not fso.FileExists( strFilename) then
    Response.Write( "<h1>Reques ted file does not exists! Please contact Roctek
    Support.</h1><P>")
    Response.End
    end if
    Set fFile = fso.GetFile(str Filename)
    iFileLength = fFile.Size

    stFile.LoadFrom File(strFilenam e)

    Response.AddHea der "Content-Disposition", "attachment ; filename=" &
    fFile.Name
    Response.AddHea der "Content-Length", iFileLength
    Response.Charse t = "UTF-8"
    Response.Conten tType = "applicatio n/octet-stream"

    Response.Binary Write 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]

    #2
    Re: Script timed out Message added to Binary File End

    Prabhat wrote:[color=blue]
    > Hi Friends,
    >
    > I have code that will "BinaryWrit e" 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>Acti ve 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.ScriptTi meout 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.ScriptTi meout =<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.


    Comment

    • Prabhat

      #3
      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.ScriptTi meout =<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.ScriptTi meout = 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


      Comment

      • Prabhat

        #4
        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.ScriptTi meout =<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:



        Comment

        • Bob Barrows [MVP]

          #5
          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.ScriptTi meout =<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.


          Comment

          • Bob Barrows [MVP]

            #6
            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.ScriptTi meout =<whatever value it takes to eliminate the
            >> error>
            >>[/color]
            > Hi Bob,
            >
            > I am aware that we can use <% Server.ScriptTi meout = 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.


            Comment

            • Prabhat

              #7
              Re: Script timed out Message added to Binary File End

              Hi Bob,

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

              Thanks
              Prabhat


              Comment

              • Anthony Jones

                #8
                Re: Script timed out Message added to Binary File End


                "Prabhat" <not_a_mail@hot mail.com> wrote in message
                news:%23LHWzR5b GHA.3504@TK2MSF TNGP04.phx.gbl. ..[color=blue]
                > Hi Friends,
                >
                > I have code that will "BinaryWrit e" 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>Acti ve 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.ScriptTi meout
                > 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(st rFilename)
                > dim stFile
                > Response.Buffer = True
                > Response.Clear
                >
                > Set stFile = Server.CreateOb ject("ADODB.Str eam")
                > stFile.Open
                > stFile.Type = 1 'Set as BINARY
                >
                > On Error Resume Next
                >
                > Set fso = Server.CreateOb ject("Scripting .FileSystemObje ct")
                > if not fso.FileExists( strFilename) then
                > Response.Write( "<h1>Reques ted file does not exists! Please contact[/color]
                Roctek[color=blue]
                > Support.</h1><P>")
                > Response.End
                > end if
                > Set fFile = fso.GetFile(str Filename)
                > iFileLength = fFile.Size
                >
                > stFile.LoadFrom File(strFilenam e)
                >
                > Response.AddHea der "Content-Disposition", "attachment ; filename=" &
                > fFile.Name
                > Response.AddHea der "Content-Length", iFileLength
                > Response.Charse t = "UTF-8"
                > Response.Conten tType = "applicatio n/octet-stream"
                >
                > Response.Binary Write 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.



                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.


                Comment

                • Prabhat

                  #9
                  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


                  Comment

                  • Dave Anderson

                    #10
                    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.


                    Comment

                    • Anthony Jones

                      #11
                      Re: Script timed out Message added to Binary File End


                      "Prabhat" <not_a_mail@hot mail.com> wrote in message
                      news:OSTIfrDcGH A.1324@TK2MSFTN GP04.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.


                      Comment

                      • Prabhat

                        #12
                        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



                        Comment

                        • Dave Anderson

                          #13
                          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:



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


                          Comment

                          • malcolm

                            #14
                            Re: Script timed out Message added to Binary File End


                            Bank Charges Refunded


                            Free help to recover your bank or credit card charges from




                            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.


                            Comment

                            Working...