asp.net学习教程:Asp.net MVC 处理文件的上传下载
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 06:09:02 ASP.NET
asp.net学习教程:Asp.net MVC 处理文件的上传下载ASP.NET
【无忧考网-asp学习教程:Asp MVC 处理文件的上传下载】:
ASP.NET
1 2 3 4 5 6 7 | method= "post" enctype= "multipart/form-data" >
name= "FileUpload1" />
name= "Submit" id= "Submit" value= "Upload" />
|
1 2 3 4 5 6 7 8 9 10 11 | <%
using (Html.BeginForm( "" , "home" , FormMethod.Post, new {enctype= "multipart/form-data" }))
{%>
name= "FileUpload1" />
name= "Submit" id= "Submit" value= "Upload" />
<% }%> |
码
1 2 3 4 5 6 7 | public static bool HasFile( this HttpPostedFileBase file)
{
return (file != null && file.ContentLength > 0) ? true : false ;
} |