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等上传文件(包括所有插件中的上传文件)0 \, c# R4 B% H' j
# S( P- Q" C( j% F; i查找文件中的代码:) t: K+ Y: \% X0 R. {
FileExt=Lcase(File.FileExt)
) N9 k0 h; X8 _. r6 P8 \; j3 o '判断文件类型/ O. `" p+ W m8 w c
If CheckFileExt(FileExt)=false then
% f. {' X+ A9 n+ l8 A. `+ r4 g Response.write "文件格式不正确,或不能为空 [ 重新上传 ]". U. j+ u/ \) ?( T1 H/ ?
EXIT SUB b, F: Z3 G2 z3 N) u$ W' R6 }6 G
End If
$ i5 X% Y2 N) z: q2 B* {& w- j, `/ |
将其中的* G1 k3 n9 i7 \9 I% H9 I
FileExt=Lcase(File.FileExt)& v" \6 S5 p2 `0 Y
. D N. N# D2 a
替换为下面代码:: w! c0 n( O y& g+ |6 i) _
: l2 S- J7 M- S5 R& Y0 a
FileExt=FixName(File.FileExt)
) {; {$ f# n7 Z1 B8 n4 n" @# R" x
" H9 R# }9 O% @formPath= Replace(Replace(formPath,Chr(0),""),".",""); t4 E8 @( r' j/ q1 n5 t" O- B8 o
) T) B( v" V5 O: v0 H$ R. T下面的代码放在asp文件的最后 "%>"前
# F1 ] B7 S8 MFunction FixName(UpFileExt)4 B' V% r* W& I/ r5 Y6 G7 y
If IsEmpty(UpFileExt) Then Exit Function
- q5 b( p+ e0 K) W$ U, qFixName = Lcase(UpFileExt)
! w. i! P- T7 x0 K0 m8 @. Y( |+ MFixName = Replace(FixName,Chr(0),"")
' y% G6 E6 u, M% ~FixName = Replace(FixName,".",""), a) z3 j+ B5 e+ Z
FixName = Replace(FixName,"asp","")
f# _' | h8 |+ j) y2 mFixName = Replace(FixName,"asa","")8 K, H* `6 k% G- k; M }
FixName = Replace(FixName,"aspx","")6 g# d; _9 n# d* h8 r
FixName = Replace(FixName,"cer","")
1 B/ x9 H6 ]) H# C! x3 \8 p0 s+ dFixName = Replace(FixName,"cdx","")
* {. I+ v( K' X( {/ {FixName = Replace(FixName,"htr","")+ \; M) v' x3 e+ Z, o
FixName = Replace(FixName,"php","")% N; p; t- U) A8 M9 m# h) ^
End Function
, I6 k" G3 a; p3 C( \- J( y. t4 I5 w6 r
. X& G% D1 p4 `% H. P |
|