asp.net源码下载:Asp.net MVC 处理文件的上传下载
asp.net源码下载:Asp.net MVC 处理文件的上传下载ASP.NET
【51Test.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 ;
} |