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等上传文件(包括所有插件中的上传文件)7 R: ^4 d( d# ]7 g9 v, n
6 q$ `- W: a, U. {查找文件中的代码:( D0 I$ M5 G+ R) c
FileExt=Lcase(File.FileExt)
, L( m: I( [( o, m% `* c '判断文件类型8 A! S a$ k, p/ I2 s J( L0 J. H/ r
If CheckFileExt(FileExt)=false then8 [: T7 W) J6 A5 E6 K/ {0 I
Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
3 \: c. ^7 G, S# Y EXIT SUB7 u: x& N+ d6 T t4 r# x+ ~
End If
: V" u' M$ G! U& U+ m R7 @; c9 r7 [
将其中的# e4 u& J+ n) h
FileExt=Lcase(File.FileExt)2 m% V" y. B# h6 b& i9 V0 J: n9 L ]
+ s4 h" D) Q3 g: ^6 f4 r1 A替换为下面代码:" m. U6 }" C- Y1 l* t
* g, b# e7 I7 ]. d! }4 DFileExt=FixName(File.FileExt)2 v& Z) O' I/ Q g$ M* |
2 Q i# n7 P% \% [' _
formPath= Replace(Replace(formPath,Chr(0),""),".","")
$ S0 U& `# p. [/ ]
) x) P8 R) q- C下面的代码放在asp文件的最后 "%>"前
6 d. _9 A) S8 Y' J" F% zFunction FixName(UpFileExt)
/ T4 U" l) I9 r; `" |& b! OIf IsEmpty(UpFileExt) Then Exit Function7 F' p) _( p: [' T. r3 T
FixName = Lcase(UpFileExt)
% r1 |7 Z+ n% [ ]+ d, c& G* vFixName = Replace(FixName,Chr(0),""): z e+ @8 h A# r0 j7 L
FixName = Replace(FixName,".","")& D# F: s9 m! x0 ~
FixName = Replace(FixName,"asp","")& [% J2 N/ o" u% n6 f1 g
FixName = Replace(FixName,"asa",""): F) }- t; s6 L- p L7 z4 `3 q
FixName = Replace(FixName,"aspx","")- G5 P$ ^$ S- T- `* q) `6 g5 @
FixName = Replace(FixName,"cer","")
9 q ?7 w, v( NFixName = Replace(FixName,"cdx","")
2 ^; l: P9 F& q8 aFixName = Replace(FixName,"htr","")
/ C# [ o0 [. M8 V Y FixName = Replace(FixName,"php","")) ~8 u7 @% c# a- _5 J
End Function
' [5 T7 @) E# x" [& g% N3 m& m4 u \" x5 Z
0 t5 f/ |& }' r* w |
|