![]() |
#2
永夜的极光2007-11-08 18:25
|
原代码:
……
if file.FileName<>"" then
Dim getimageExt
Set getimageExt = CreateObject("Scripting.FileSystemObject")
GetAnExtension = getimageExt.GetExtensionName(file.FileName)
if GetAnExtension<>"jpg" and GetAnExtension<>"gif" and GetAnExtension<>"JPG" and GetAnExtension<>"GIF" then
%>
<SCRIPT language=javascript>
alert("文件格式不对,请重新上传");
opener.document.all("id_uploadstr").style.display="none";
window.close();
</SCRIPT>
……
修改后:
……
if file.FileName<>"" then
Dim getimageExt
Set getimageExt = CreateObject("Scripting.FileSystemObject")
GetAnExtension = getimageExt.GetExtensionName(file.FileName)
if GetAnExtension<>"jpg" and GetAnExtension<>"gif" and GetAnExtension<>"swf" and GetAnExtension<>"JPG" and GetAnExtension<>"GIF" and GetAnExtension<>"SWF" then
%>
<SCRIPT language=javascript>
alert("文件格式不对,请重新上传");
opener.document.all("id_uploadstr").style.display="none";
window.close();
</SCRIPT>
……
请问我的修改正确吗,完善吗?若不行,我该怎么做?
[此贴子已经被作者于2007-11-8 18:12:57编辑过]