<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<%@ Import Namespace="System.Web " %>
<html>
<head>
    <script language="C#" runat="server">
	void ExecUpload(Object sender,EventArgs e){
	if(Text1.Value==""){
		Span1.InnerHtml = "未选择文件";
		return;
	}
	if(File1.PostedFile!=null){
		try{
			File1.PostedFile.SaveAs(Request.PhysicalApplicationPath + Text1.Value);
			Span1.InnerHtml = "完成上传至" + Request.PhysicalApplicationPath + Text1.Value + "<br>上传大小：" + File1.PostedFile.ContentLength + "字节数";
		}
		catch(Exception Uperr){
			Span1.InnerHtml = "错误，无法上传至" + Request.PhysicalApplicationPath + Text1.Value + "，可能路径不存在<br>系统错误信息：" + Uperr.ToString();
		}
	}
	}
    </script>
</head>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
    <form enctype="multipart/form-data" runat="server">
        选择上传文件: <input id="File1" type=file runat="server" size="30"><p>
        上传为(不含路径): <input id="Text1" type="text" runat="server" SIZE="30"><p>
        <span id=Span1 style="font: 9pt verdana;" runat="server" /><p>
        <input type=button id="Button1" value="执行上传" OnServerClick="ExecUpload" runat="server">
    </form>
</body>
</html>



