_upload_file.vm

来自「一个简单的blog系统」· VM 代码 · 共 36 行

VM
36
字号
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>upload</title>
    <style>
    	body,input {font-size: 12px; font-family: "Verdana", "Verdana"}
    	.button { border-width: 1px; height:18px;}
    </style>
</head>
<body leftmargin='10' topmargin='0' marginwidth='0' marginheight='0'>
<form method="POST" enctype="multipart/form-data" action="$dlog.root()/servlet/fckeditor_upload" onsubmit="return check(this);">	
    <input type="hidden" name="fromPage" value="/html/diary/_upload_file.vm">	
    <input type="hidden" name="Type" value="Image">
    <input type="file" name="NewFile" size="38" class="button">
    <input type="submit" value="上传" name="eventSubmit_UploadImage" class="button">
</form>
</body>
<script type="text/javascript" src="$dlog.root()/js/common.js"></script>
<script language="javascript">
function check(theForm){
	if(is_empty(theForm.NewFile.value)){
		alert("请选择要上传的图片.");
		return false;
	}
	theForm.eventSubmit_UploadImage.disabled = true;
	return true;
}
	#if($upload_image_errno && $upload_image_errno != 0)
		alert('$upload_image_msg');
	#elseif($upload_image_errno && $upload_image_errno == 0)
		var oEditor = parent.FCKeditorAPI.GetInstance("content");
		var html = "<img src='$upload_image_uri'/>";
		oEditor.InsertHtml(html);
	#end
</script>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?