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等上传文件(包括所有插件中的上传文件)
+ w9 ^$ e5 D W$ c7 l' f! r
' d' J' ~+ g' w& ~- d查找文件中的代码:
4 h9 m: F/ ]% O" U$ e( o FileExt=Lcase(File.FileExt)2 ^0 U, U8 B/ K( S" s
'判断文件类型$ {9 X2 {7 x1 H* D8 k, Z# c
If CheckFileExt(FileExt)=false then
* X. Z7 W& J4 v Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"7 n! N( K) E" W' J4 P
EXIT SUB4 J4 f8 t2 u7 L" E J
End If
8 C K% _1 b6 [4 K) L9 x7 \
) d) f) s& I( Y+ H" t将其中的
( r5 Z0 Z' C9 |7 ]FileExt=Lcase(File.FileExt)
9 X+ }5 j/ U; q6 i: e4 H7 G* _, i- t( Q( S
替换为下面代码:' i. k; s; i0 Q' Q, k2 l$ C
$ N0 `5 b# A, ]/ p4 B$ XFileExt=FixName(File.FileExt)
5 s2 n9 j; X% _
0 J1 v( t1 ? Y3 Q1 a! T# \9 J8 mformPath= Replace(Replace(formPath,Chr(0),""),".","")- B: \( G1 q; ]! ?+ }& ?
6 a8 i- O ?8 v' m2 r下面的代码放在asp文件的最后 "%>"前% f Z/ }: o6 o, l/ m# O' C: O
Function FixName(UpFileExt)" X4 H+ `7 R$ e5 b) e
If IsEmpty(UpFileExt) Then Exit Function6 Q+ F! |# \: f @, W5 k! U
FixName = Lcase(UpFileExt)' N* ^+ Z6 X- W7 `: U) r0 K
FixName = Replace(FixName,Chr(0),"")
$ E9 i, {8 C. @2 F1 v# UFixName = Replace(FixName,".","")
8 `% ~8 o, o9 k) m( b" `FixName = Replace(FixName,"asp","")
( {% T2 C9 w5 ?5 W. H EFixName = Replace(FixName,"asa","")
4 N+ Y+ ]6 w7 W! LFixName = Replace(FixName,"aspx","")
) f! x" [( Y) _' a# y; dFixName = Replace(FixName,"cer","")$ h" t) \3 ?; j
FixName = Replace(FixName,"cdx","")1 [/ @2 P* k( D9 [) u( h" s
FixName = Replace(FixName,"htr","")' j/ n/ g! n# @) n% Q7 \3 v$ {
FixName = Replace(FixName,"php","")* `$ ^" X: [! T) N8 l6 @$ {5 u
End Function
3 J6 b" H9 r: H6 R) E
; i; h. e! K% F( C Z2 B, V
" L4 {$ T) J2 O% f5 z2 G! E |
|