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 = fspenTextFile(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.
Thanks.
<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 = fspenTextFile(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.
Thanks.