褚时健传txt网盘下载:这样的文件上传限制还能绕过去吗?

来源:百度文库 编辑:神马品牌网 时间:2024/05/10 14:19:14
偶对文件上传的格式做了如下限制,讨论一下还能绕过去吗?
'-----------------------------------------------------------------------------------
'格式后缀
'-----------------------------------------------------------------------------------
Private Function FixName(Byval UpFileExt)
If IsEmpty(UpFileExt) Then Exit Function
FixName = Lcase(UpFileExt)
FixName = Replace(FixName,Chr(0),"")
FixName = Replace(FixName,".","")
FixName = Replace(FixName,"'","")
FixName = Replace(FixName,"asp","")
FixName = Replace(FixName,"asa","")
FixName = Replace(FixName,"aspx","")
FixName = Replace(FixName,"cer","")
FixName = Replace(FixName,"cdx","")
FixName = Replace(FixName,"htr","")
FixName = Replace(FixName,"shtml","")
End Function

'-----------------------------------------------------------------------------------
'判断文件类型是否合格
'-----------------------------------------------------------------------------------
Private Function CheckFileExt(FileExt)
Dim Forumupload,i
CheckFileExt=False
If FileExt="" or IsEmpty(FileExt) Then
CheckFileExt = False
Exit Function
End If
If FileExt="asp" or FileExt="asa" or FileExt="aspx" or FileExt="shtml" Then
CheckFileExt = False
Exit Function
End If
Forumupload = Split(InceptFile,",")
For i = 0 To ubound(Forumupload)
If FileExt = Trim(Forumupload(i)) Then
CheckFileExt = True
Exit Function
Else
CheckFileExt = False
End If
Next
End Function

偶对文件上传的格式做了如下限制,讨论一下还能绕过去吗?(回答)
本人绞尽脑子想不出有什么办法可一饶过的!!
不过人家知道你的限制的话,把后缀名删掉或改成你允许的呢??
不也样可以吗?/?