<?php 
defined('IN_HS') or exit('Access Denied');
include admintpl('header');
?>

<script type="text/javascript">
  function Check(){
	var v = $('uploadfile').value;
	if(!v){
		alert('请选择文件');
		return false;
	}
	var fileext = v.substring(v.lastIndexOf('.')+1, v.length);
	if(fileext.length>4 || fileext.length<2){
		alert('无效的文件地址');
		return false;
	}
	fileext = fileext.toLowerCase();
	var allow = "<?=$CHA['uploadfiletype']?>";
	if(allow.indexOf(fileext) == -1){
		alert('允许上传的文件格式是:'+allow);
		return false;
	}
	$('submit').value = '正在上传...';
	return true;
}
</script>
<table cellpadding="0" cellspacing="0" width="100%" style="margin:0px">
	<form name="upload" method="post" action="?mod=<?=$mod?>&file=<?=$file?>&channelid=<?=$channelid?>&dosubmit=1" enctype="multipart/form-data" onsubmit="return Check();">
	<tr>
	<td class="tablerow">
	<input type="file" class="btn" name="uploadfile" size="30" id="uploadfile">
	<input type="hidden" name="rename" value="1" checked>
	<input type="submit" class="btn" id="submit" value=" 上传 ">
	</td>
	</tr>
	</form>
	</table>
</body>
</html>