检查经典asp中的上传文件内容类型 [英] check upload file content type in classic asp
本文介绍了检查经典asp中的上传文件内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查经典asp中的上传文件内容类型?
how to check upload file content type in classic asp?
推荐答案
<%@ language="VBScript" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script language="javascript" type="text/javascript">
function checkImage(img) {
if (img != '' && img.substring(img.length - 3, img.length).toLowerCase() != 'jpg' && img.substring(img.length - 3, img.length).toLowerCase() != 'gif' && img.substring(img.length - 3, img.length).toLowerCase() != 'bmp' && img.substring(img.length - 3, img.length).toLowerCase() != 'png')
return true
else
return false
}
function check() {
var str = '';
var strFocus = '';
var img = document.frmCategory.Cat_Image.value;
if (checkImage(img)) {
str += "Select proper image.";
if (strFocus == '') strFocus = 'Cat_Image';
}
if (str != '') {
alert(str);
if (document.getElementById(strFocus) != null)
document.getElementById(strFocus).focus();
return false;
}
}
</script>
</head>
<body>
<form method="post" action="" id="frmCategory" name="frmCategory" onsubmit="return check();">
<input type="file" id="Cat_Image" name="Cat_Image" value="" />
<img src="images/save.jpg" alt="Save" width="60" height="20" border="0" onclick="javascript:check();" />
</form>
</body>
</html>
试试此链接
http://globalbanke.com/uploadFiles.asp?CustomName=Red
try this link
http://globalbanke.com/uploadFiles.asp?CustomName=Red
你到底想要检查什么?
这篇关于检查经典asp中的上传文件内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文