ASP.NET 开发中,通过 POST 方式将文件上传至IIS服务器。
主要用到的方法
<%-- 前端文件上传 --%>
<asp:FileUpload ID="FileUpload1" runat="server" />
'后端获取所选的文件数据流
FileUpload1.SaveAs(m_SavePath)
前端代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<%-- 前端文件上传 --%>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="上传" OnClick="Butto