<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>要俩源码</title>
    <meta http-equiv="keywords" content="要俩源码" />
    <meta name="description" content="要俩源码" />

    <script language="javascript" type="text/javascript">
        function checkExt(obj) {
            var path = obj.value;
            var extensions = 'rar,zip';
            var ext = path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase();
            var re = new RegExp("(^|\\s|,)" + ext + "($|\\s|,)", "ig");
            if (path == '') {
                return;
            }
            if (extensions != '' && (re.exec(extensions) == null || ext == '')) {
                obj.value = "";
                alert('对不起，不支持上传此类扩展名的附件。');
                return;
            }
        }
    </script>

</head>
<body style="margin: 0px; font-size: 12px">
    <form name="form1" id="form1" enctype="multipart/form-data" action="/upload.aspx" method="post">
    <input type="file" id="upfile" name="upfile" onchange="checkExt(this);" />&nbsp;&nbsp;
    <input type="submit" value=" 上 传 "/>
    <br />
    目前只允许上传rar，zip两种扩展名的文件。
    </form>
</body>
</html>
