TA的每日心情 | 慵懒 2014-10-21 10:00 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
找到 post_upfile.asp、upfile.asp、z_visual_upfile.asp、NF_visual_upfile.asp、saveannouce_upfile.asp等上传文件(包括所有插件中的上传文件)
' f" J+ U6 M1 g" E
; S) M7 {4 C' @! l+ N- {& z查找文件中的代码:
0 H: F0 D/ C E( S FileExt=Lcase(File.FileExt)) n v2 N* F: t H
'判断文件类型( M! b) x3 P4 b9 @6 {; K7 e
If CheckFileExt(FileExt)=false then# x- b' \7 _ U; u
Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
1 {. K, o4 R1 x7 X& A EXIT SUB
/ t2 Q4 v( i: [: y End If3 L3 h) f3 K/ f# L
$ } e0 z; P/ u2 p9 b6 Y
将其中的
2 A+ J8 s2 j0 I3 `/ d: OFileExt=Lcase(File.FileExt)# T9 p; g% ~( m+ A+ x( P. Z. ]
' }/ \! F/ a# {6 X+ N' [替换为下面代码:
1 `. M$ [5 i$ J' E3 m c, w8 w$ e7 M* n5 V% C
FileExt=FixName(File.FileExt)* c9 {3 I& |) t4 G0 \
, K6 _8 N9 v" J3 J) P' Q# }formPath= Replace(Replace(formPath,Chr(0),""),".","")
- \- c* e) C# k5 C' ^% h4 @3 Z' D# I7 q
下面的代码放在asp文件的最后 "%>"前) I6 v+ T. u! V. x8 B
Function FixName(UpFileExt), _' A, j8 F$ i! r0 p. x9 T
If IsEmpty(UpFileExt) Then Exit Function
5 n2 I/ P8 u$ {: z# H" H, wFixName = Lcase(UpFileExt)
' ^3 B4 N6 y2 e' L/ Q' g( RFixName = Replace(FixName,Chr(0),"")& R5 C4 _( [' _. k. b9 r9 z
FixName = Replace(FixName,".","")9 Y% H* _" M b! T' _
FixName = Replace(FixName,"asp","")7 x4 r Q% o5 E- C! V6 b4 v
FixName = Replace(FixName,"asa","")8 b3 f, t" ~$ f n) A9 u" O
FixName = Replace(FixName,"aspx","")7 o. Z& }" P& @$ l6 q
FixName = Replace(FixName,"cer","")8 J' X8 {/ f) T& Q' U7 ?1 a: N
FixName = Replace(FixName,"cdx","")
: v. }* K. v4 P3 W0 qFixName = Replace(FixName,"htr","")" W. _! A8 q% n0 v
FixName = Replace(FixName,"php","")
" e# m0 i1 K/ A7 H' F# |End Function
# m( b& n- x6 H: R x0 z2 k
9 u" K; F3 ?) E% }9 C) d/ Q9 R) c+ I \6 }1 Q- A3 o4 V' v
|
|