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等上传文件(包括所有插件中的上传文件)0 M B+ w; F* T. Z$ m {( C+ {
' u. p l8 y, k! R
查找文件中的代码:
2 ^2 N j" e z- f7 F* l, p FileExt=Lcase(File.FileExt)
" ?# H4 ^/ d' f6 u I '判断文件类型
& R9 }8 s a7 B& e+ k1 v If CheckFileExt(FileExt)=false then
4 w( a, E. I5 q3 F! D N Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
1 c' U k5 {. P* e4 P* F EXIT SUB2 }! @; _' x) d' N9 @( d6 T8 ^
End If
. [% D/ A" p! ?4 P+ T, U/ e! y. M4 J. q
将其中的 A. u7 ^ Q7 C# p" }$ O! ~
FileExt=Lcase(File.FileExt)3 ~, k% z% s( ]$ r' f4 w
$ X0 g A s( Q替换为下面代码:6 O2 l+ C7 ~$ f: [/ ]) u- s1 W
4 h7 w" V' Y: O- ^; a5 ^% y
FileExt=FixName(File.FileExt)
) i, Z' R G* N# `4 m) F2 R: S7 ~- S+ Q
formPath= Replace(Replace(formPath,Chr(0),""),".","")
' k2 v( U, A: u. p# S$ a& o) ?0 ~5 j4 P8 r& o) w
下面的代码放在asp文件的最后 "%>"前' p! |3 R1 ~' U( p
Function FixName(UpFileExt)
; K/ H% L2 i9 c6 D& s& J+ hIf IsEmpty(UpFileExt) Then Exit Function, ]: Z. e, Z# _1 z2 K
FixName = Lcase(UpFileExt)- z( R3 d2 U- X n% I
FixName = Replace(FixName,Chr(0),""); F7 q/ Y$ h$ |4 `# |
FixName = Replace(FixName,".","")6 H( O0 q" T. ]5 Z" x/ O
FixName = Replace(FixName,"asp","")* S4 S/ P" p9 b3 _
FixName = Replace(FixName,"asa",""). D+ I5 J. `. \0 `
FixName = Replace(FixName,"aspx","")) k3 h# }0 N: m
FixName = Replace(FixName,"cer","")2 i& T# L; C# a9 S5 C% R
FixName = Replace(FixName,"cdx","")( j$ N- p8 _ p# ?4 \" [7 N; \3 v
FixName = Replace(FixName,"htr","")
( g. c" b( C; ^7 T$ F* P, A& x1 B& J FixName = Replace(FixName,"php","")
3 i' m3 ~1 g- W% a* V" {End Function
# Q8 f- x/ v, Z& L/ {) S/ \' u: j9 [4 Y4 {
3 v. t0 o7 W i. P2 S9 ~+ y |
|