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等上传文件(包括所有插件中的上传文件)$ A+ e' v, @/ g
" |+ {: G6 [0 V+ ]; H查找文件中的代码:7 e0 {5 s' Z2 ] s
FileExt=Lcase(File.FileExt)* X" d. l3 V& R9 j
'判断文件类型. U8 h# v0 u+ e: ?9 R1 V4 w
If CheckFileExt(FileExt)=false then
" p! V6 k' W6 E4 ]5 I4 Z: D Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"+ N. k, S2 L* x" n6 {7 A: _2 m3 J
EXIT SUB% W7 f) d @# i9 [1 ~ f }7 h
End If
; d# O+ O$ `! `8 i) P
/ V; i$ s; P6 r$ m% B将其中的" n- l; f& ]' A& j4 e
FileExt=Lcase(File.FileExt)
, ~( a4 F9 z/ m5 `5 _" z; p: k: N( m. A6 l$ D
替换为下面代码:
, B! z+ J$ x- K2 b) Z4 V
* r3 ?" ?. K3 W( jFileExt=FixName(File.FileExt)
# U; i3 k1 [. B8 q M7 t# f( I# {: B( }. W; _- v
formPath= Replace(Replace(formPath,Chr(0),""),".","")% ` X) _9 P M0 O) ~$ W
6 i2 }* |2 J- |8 E
下面的代码放在asp文件的最后 "%>"前
3 J- I+ D+ {3 P& oFunction FixName(UpFileExt)
7 ?+ w' |* }: R rIf IsEmpty(UpFileExt) Then Exit Function
6 [0 ` |6 e/ v# P4 OFixName = Lcase(UpFileExt)
0 o4 ^: {: }9 _7 eFixName = Replace(FixName,Chr(0),"")
* w0 W! V- \( U3 C. rFixName = Replace(FixName,".","")0 H* T0 c4 F" ^9 d% L
FixName = Replace(FixName,"asp","")- t) R1 W) W- {, E% X$ F
FixName = Replace(FixName,"asa","")6 d% D9 t; d& a g8 M3 z& L
FixName = Replace(FixName,"aspx","")
/ w! V4 L- t0 jFixName = Replace(FixName,"cer","")8 m& W5 t1 s+ L; y' `; i
FixName = Replace(FixName,"cdx","")
. b! ^5 S1 {4 k4 @/ P4 D) I4 vFixName = Replace(FixName,"htr","")
- [8 w+ Q" Y4 Z+ Y) x6 o& Z FixName = Replace(FixName,"php","")
' m* C& J+ s" p+ g: g$ h; GEnd Function
4 `- s$ |, \& p) ] C$ }7 L7 u4 s$ X& M& G/ Q4 D, t
/ A# N, y( d, y/ S( A' x |
|