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等上传文件(包括所有插件中的上传文件)
6 Y+ D% \- S9 j: n9 f& d/ G, S6 `- `2 `9 c' q1 s0 T, _' r
查找文件中的代码:2 o# X9 ^+ j) f- ~/ D
FileExt=Lcase(File.FileExt)
: I, ^7 l( {. N7 G4 x9 d, [# m '判断文件类型
7 g2 i# g2 N" e! c4 v8 c If CheckFileExt(FileExt)=false then5 H0 Q& n- N! J2 F* M' o
Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
1 h* J2 R. P: v: l0 A EXIT SUB9 {) \; N& D- L
End If" d4 D0 X3 ]! c( Q4 r, }4 q" i% u
+ c2 r5 s8 |( C( ` s7 p/ ~& J
将其中的
7 l1 k* c0 x) {: E2 ]" m9 M6 P9 ]FileExt=Lcase(File.FileExt)
: y" L$ G0 W0 o/ y, S; ~) s; X
9 t0 Y' _/ D/ {) J9 c3 X替换为下面代码:
8 X1 ~ I1 n z2 e* h4 a ~
9 [% {& o/ n- g' }5 DFileExt=FixName(File.FileExt)4 O1 r e5 i2 G7 A: X
$ i- N2 ~& D& EformPath= Replace(Replace(formPath,Chr(0),""),".","")
& c5 v7 q- ^9 p8 h; F2 ], t
8 s' h4 \& u! ~- `下面的代码放在asp文件的最后 "%>"前& L9 Q" p N3 z! u! _/ L% r
Function FixName(UpFileExt)
* W& u, V/ _- y) \8 w7 yIf IsEmpty(UpFileExt) Then Exit Function
# w5 c8 ?" |4 Y1 LFixName = Lcase(UpFileExt)
. u) t1 m0 Y- B' |( }FixName = Replace(FixName,Chr(0),"") |2 z% l* |+ e
FixName = Replace(FixName,".","")# v$ g& I2 A5 b) `+ S) R3 t
FixName = Replace(FixName,"asp","")
$ `; m, U; P4 [- y* x: cFixName = Replace(FixName,"asa","")
# W6 w$ x( u2 r" e& ?FixName = Replace(FixName,"aspx","")
$ k- B3 L8 q0 v- OFixName = Replace(FixName,"cer","")3 E8 b! V3 b$ B
FixName = Replace(FixName,"cdx","")2 f- c# S1 [1 o6 g0 D z r; N$ e; s
FixName = Replace(FixName,"htr","")/ R T2 ?8 a* B5 X- {
FixName = Replace(FixName,"php","")9 w4 ?7 Y6 H0 t+ z- ?) Q2 V" X" j
End Function
( x$ S3 b- g7 K9 B. Z+ u4 c& Y" M5 w- _$ W' o' \+ D, e5 @" X
5 T( Y+ w1 g& j. C |
|