Progress bar for upload

Discussion in 'C#' started by erhancom, Feb 23, 2007.

  1. #1
    My upload code:

    <form enctype="multipart/form-data" action="?newup=1" method="post" id=form1 name=form1>
    <input type=file name=file>
    <input type=submit value=submit name=submit>
    </form>
    <%
    If Request.QueryString("newup") = 1 Then
    asdfg = Request.BinaryRead(Request.TotalBytes)
    LenBinary = LenB(asdfg)
    If LenBinary > 0 Then
    Set RST = CreateObject("ADODB.Recordset")
    RST.Fields.Append "myBinary", 201, LenBinary
    RST.Open
    RST.AddNew
    RST("myBinary").AppendChunk asdfg
    RST.Update
    strData = RST("myBinary")
    RST.Close
    Set RST = Nothing
    End If
    'FileName
    fnbgn = instr(1, strData, "file") + 17
    fnend = instr(fnbgn, strData, chr(34))
    FileName = Mid(strData,fnbgn,(fnend - fnbgn))
    'BinaryData
    dbbgn = instr(1, strData, "file")
    dbbgn = instr(dbbgn, strData, chr(10)) + 1
    dbbgn = instr(dbbgn, strData, chr(10)) + 1
    dbbgn = instr(dbbgn, strData, chr(10)) + 1
    dbend = instr(dbbgn, strData, "-----") - 2
    BinaryData = Mid(strData,dbbgn,(dbend - dbbgn))
    FileSize = Len(BinaryData)

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fs:confused:penTextFile(Server.MapPath("\")&"\"&fso.GetFi leName(FileName), 2, True)
    f.Write BinaryData
    Set f = Nothing
    Set fso = Nothing
    End If

    Response.Write "Upload Ok."
    %>

    I Need a progress bar for this code.

    Example Script : http://support.persits.com/upload/progress.asp

    Can you take a look above link?

    Thanks.
     
    erhancom, Feb 23, 2007 IP
  2. DaDMan

    DaDMan Guest

    Messages:
    566
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are'nt they offering the source code on the very same link you've proposed??
     
    DaDMan, Feb 23, 2007 IP