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等上传文件(包括所有插件中的上传文件)
/ O; n5 M6 p2 ^# Y; i0 s
% a9 }$ Y0 ^$ t" k0 k查找文件中的代码:" c" N) C' S3 {! x. P6 g
FileExt=Lcase(File.FileExt)
( i6 P7 P+ x* f! G) N8 b '判断文件类型4 X- S0 T# c. E P/ O
If CheckFileExt(FileExt)=false then
, r$ e t* J+ y' |. {3 l+ ~ Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
! F6 ~' W# |" t! |! ?8 m EXIT SUB/ b" c z* L, o8 \3 _7 ^# ^
End If
$ _1 E, \& J# I: N- X
# q- N2 q6 _/ `( E' g将其中的
, [5 e. X$ c( w2 I% d# Q' dFileExt=Lcase(File.FileExt)9 t7 r* R) ]9 Q: r/ m! m) J
+ y3 ^/ Y3 w9 t* P" m( N, x9 F替换为下面代码:
H4 {5 x* w" ?: X6 e/ D
# c9 d2 J! w7 J- p$ s* ~) i& e9 ]! h0 gFileExt=FixName(File.FileExt)
) v/ j9 F i# X/ e* l' j
! X3 n8 x0 x- B( y0 q+ e; g; SformPath= Replace(Replace(formPath,Chr(0),""),".","")* }, Q2 }7 R G1 f
6 p8 K, v- ^/ m% ?- P, G下面的代码放在asp文件的最后 "%>"前2 E$ }6 R7 X' z% a: d, ~! [
Function FixName(UpFileExt), B& } J* y2 D, }9 l' V; P8 X
If IsEmpty(UpFileExt) Then Exit Function- M: {, D& R+ }: f
FixName = Lcase(UpFileExt)
9 l+ n( h+ ^8 n: g+ ^# P; |. _FixName = Replace(FixName,Chr(0),"")
4 }* N. }; M0 k6 _FixName = Replace(FixName,".","") ?2 P7 Q( ~$ e% f p
FixName = Replace(FixName,"asp","")8 i# _& o6 j" g7 \
FixName = Replace(FixName,"asa","")
V% |* X) @) u: n% EFixName = Replace(FixName,"aspx","")
/ e& T+ q; G- s# E" QFixName = Replace(FixName,"cer","")
. o7 z* X2 s+ X8 @$ e+ |9 U+ {! MFixName = Replace(FixName,"cdx","")6 o, K9 P5 r. z: D ?' B9 e( f
FixName = Replace(FixName,"htr","")
) B. X4 Z) b7 k5 w* Z FixName = Replace(FixName,"php","")
/ E+ i \: T$ E. m- b( SEnd Function) T8 O; y. x9 R+ j
' f" {# ~' e; J$ |0 }' G" I; Q8 ~' {- _/ Z. j
|
|