62,243
社区成员




<script>
function ck(obj){if(obj.value.length>0){
var af="jpg,gif,png,zip,rar,txt,htm";
if(eval("with(obj.value)if(!/"+af.split(",").join("|")+"/ig.test(substring(lastIndexOf('.')+1,length)))1;")){alert("Allowed file types:\n"+af);obj.form.reset()};
}}
</script>
<form><input type=file name=path onpropertychange="ck(this)"/></form>
string fileContentType = FileUpload1.PostedFile.ContentType;
if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg")
{
//进行上传
}