2012年10月18日

MVC enctype = "multipart/form-data的作用

摘要: MVC 在用到上传文件控件时,必须添加enctype = "multipart/form-data"属性,Html.BeginForm("action","controller",FormMethod.Post,new{enctype = "multipart/form-data"}){ <input type="file" id="fileUpload" name="fileUpload" />}enctype = "multipa 阅读全文

posted @ 2012-10-18 15:31 Gcam 阅读(668) 评论(0) 推荐(0) 编辑

file 控件对上传文件大小的限制

摘要: <input type="file" name="upload" />使用此控件会限制文件大小最大上传4m可在web.config中配置<httpRuntimeexecutionTimeout= "5400"maxRequestLength= "2048000 " 文件大小useFullyQualifiedRedirectUrl= "false "/> 阅读全文

posted @ 2012-10-18 14:46 Gcam 阅读(313) 评论(0) 推荐(0) 编辑

导航