fso| Program | Upload <%
A=request.totalbytes
If A>0 Then
Set c=createobject ("ADODB.stream")
C.type=1
C.open
C.write Request.BinaryRead (a)
C.position=0
D=c.read
E=CHRB (&CHRB) (10)
F=INSTRB (D,e)
G=INSTRB (F+1,d,e)
Set H=createobject ("ADODB.stream")
H.type=1
H.open
C.position=f+1
C.copyto h,g-f-3
H.position=0
h.type=2
h.charset= "BIG5"
I=h.readtext
H.close
J=mid (I,instrrev (i, "\") +1,g)
If InStr ("jsp/asp/aspx/exe/php/html/htm/...", Right (J,len (j)-instr (J, ".")) >0 Then
Session ("error") = "you want to upload disallowed files"
Response.Redirect ("error.asp")
End If
J=replace (Date, "-", "") &right (J,len (j)-instr (J, ".") +1)
Set Fso=server.createobject ("Scripting.FileSystemObject")
If FSO. FileExists (Server.MapPath (j)) Then
I=1
Msg=true
Do While MSG
M=left (J,instr (J, ".") -1) & "(" &i& ")" &right (J,len (j)-instr (J, ".") +1)
If not FSO. FileExists (Server.MapPath (m)) then
J=m
Msg=false
End If
I=i+1
Loop
End If
Set fso=nothing
K=INSTRB (d,e&e) +4
L=INSTRB (K+1,D,LEFTB (d,f-1))-k-2
H.type=1
H.open
C.position=k-1
C.copyto h,l
H.savetofile Server.MapPath (j), 2
End If
%>
<form Enctype=multipart/form-data method=post>
<input type=file name=n/>
<input name= "Submit" Type=submit value= "submitted"/>
</form>