Visualizzazione dei risultati da 1 a 5 su 5

Discussione: error asp 0113

  1. #1

    error asp 0113

    Quando carico file pesanti con uno script per l'upload compare questo:
    Active Server Pages error 'ASP 0113'

    Script timed out

    /upload.asp

    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.

    Come posso aumentare questo limite?

    Il codice di upload.asp è:

    <%

    Dim folder
    Response.Expires=0
    Response.Buffer = TRUE
    Response.Clear
    folder = dirUpload

    Sub BuildUploadRequest(RequestBin)
    PosBeg = 1
    PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
    boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
    boundaryPos = InstrB(1,RequestBin,boundary)
    Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
    Dim UploadControl
    Set UploadControl = CreateObject("Scripting.Dictionary")

    Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition"))
    Pos = InstrB(Pos,RequestBin,getByteString("name="))
    PosBeg = Pos+6
    PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
    Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
    PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame="))
    PosBound = InstrB(PosEnd,RequestBin,boundary)
    If PosFile<>0 AND (PosFile<PosBound) Then
    PosBeg = PosFile + 10
    PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
    FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
    UploadControl.Add "FileName", FileName
    Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
    PosBeg = Pos+14
    PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
    ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
    UploadControl.Add "ContentType",ContentType
    PosBeg = PosEnd+4
    PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
    Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
    Else
    Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
    PosBeg = Pos+4
    PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
    Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
    End If
    UploadControl.Add "Value" , Value
    UploadRequest.Add name, UploadControl
    BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary)
    Loop
    End Sub
    Function getByteString(StringStr)
    For i = 1 to Len(StringStr)
    char = Mid(StringStr,i,1)
    getByteString = getByteString & chrB(AscB(char))
    Next
    End Function
    Function getString(StringBin)
    getString =""
    For intCount = 1 to LenB(StringBin)
    getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
    Next
    End Function

    byteCount = Request.TotalBytes

    RequestBin = Request.BinaryRead(byteCount)
    Dim UploadRequest
    Set UploadRequest = CreateObject("Scripting.Dictionary")

    BuildUploadRequest RequestBin

    contentType = UploadRequest.Item("blob").Item("ContentType")
    filepathname = UploadRequest.Item("blob").Item("FileName")
    filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
    value = UploadRequest.Item("blob").Item("Value")

    'Create FileSytemObject Component
    Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")

    'Create and Write to a File
    Set MyFile = ScriptObject.CreateTextFile(Server.mappath(folder) &"\"&filename)

    For i = 1 to LenB(value)
    MyFile.Write chr(AscB(MidB(value,i,1)))
    Next

    MyFile.Close
    %>
    <table border=0 width=360 cellspacing=1 align=center>
    <tr>
    <td width=400 align=center bgcolor=#000099><FONT FACE="tahoma" color=#ffffff size=2>Il
    file <%=filename%> è stato caricato con successo.
    </FONT></td>
    </tr>
    <tr>
    <td width="400" height="30" bgcolor="#eeeeee" align=center><a href=pannello.asp><font face=arial size=2 color=black>Torna
    al Pannello Principale</font></a></td>
    </tr>
    </table>
    <%
    sql = "UPDATE mess SET file_upl='" & filename & "' WHERE id = " & session("id_messaggio")
    Set rs = con.Execute(sql)
    Response.Redirect "view.asp?id=" & session("id_messaggio")
    %>

    Scusate per la lunghezza....
    Non è mai troppo tardi per vivere la propria adolescenza

  2. #2
    Prova a mettere in cima
    codice:
    <% Server.ScriptTimeout=1000 %>

  3. #3
    Non va....
    Non è mai troppo tardi per vivere la propria adolescenza

  4. #4
    Errata corrige....sembra che ora va.Provo ancora un po' e poi confermo.Grazie mille per ora.
    Non è mai troppo tardi per vivere la propria adolescenza

  5. #5

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.