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等上传文件(包括所有插件中的上传文件)1 {5 \" t F# D* e
: f% @+ D7 F% k
查找文件中的代码:0 h6 l" ~ @' m- D+ _5 t% n6 |
FileExt=Lcase(File.FileExt)2 P9 H( M# M+ J( _( x
'判断文件类型
' q; J9 ?, M$ N$ J4 p If CheckFileExt(FileExt)=false then( S+ U$ f0 K# F+ b: K. A" Y
Response.write "文件格式不正确,或不能为空 [ 重新上传 ]"
" a0 ]/ X5 s/ A! H EXIT SUB
' j& c5 {2 O6 u5 s& Z' ] End If+ [: T6 p3 ~' M6 d; p
8 v1 b1 N, j t) B$ s将其中的$ Q0 i* R, e+ x
FileExt=Lcase(File.FileExt)
6 v& n2 P; g# i K- ?5 A+ Y# _' a4 d
替换为下面代码:
# R8 R+ _7 q4 J; \, ?% G3 n4 |7 {1 d0 N
FileExt=FixName(File.FileExt)
0 N2 t% D0 x2 C: J" v
] S6 L5 I2 f+ q" I, x3 ^+ e" WformPath= Replace(Replace(formPath,Chr(0),""),".","")
. C$ P/ s8 |* x9 N8 d; H
7 b2 U% S3 g8 `6 ^3 H# \7 k下面的代码放在asp文件的最后 "%>"前7 b0 @' I) |6 q+ W
Function FixName(UpFileExt); `8 Z* ~; t. e! b p' j
If IsEmpty(UpFileExt) Then Exit Function
; N- j$ z8 V& O& i/ rFixName = Lcase(UpFileExt)
3 j2 Z! O% k6 f7 M" w) g' X6 ^FixName = Replace(FixName,Chr(0),"")
& {) i' u# G, u9 m- WFixName = Replace(FixName,".","")
5 p: ]2 X6 c" }0 M. U4 X% iFixName = Replace(FixName,"asp","")
0 Y- `- f& z+ u: C$ d8 w( m. YFixName = Replace(FixName,"asa","")
) g2 {* }' b0 y! l% nFixName = Replace(FixName,"aspx","")
* V0 m+ \; C0 I. E) y4 YFixName = Replace(FixName,"cer",""); m9 A& R# _; S% u- P
FixName = Replace(FixName,"cdx","")
4 E; L7 p' P9 j5 M V2 A, dFixName = Replace(FixName,"htr","")
0 t( K _3 V1 \% | FixName = Replace(FixName,"php","")
& u. p& r% a, J: P. T) ^& v3 _9 @End Function
3 d3 `% S3 p/ S8 y& r" U
8 j+ @! g! a6 w8 K; F/ ~7 O/ l8 f5 x/ Q5 i
|
|