读书人

MVC3 inputfile 坑爹有关问题

发布时间: 2013-01-01 14:04:19 作者: rapoo

MVC3 inputfile 坑爹问题
@using (Html.BeginForm("Execel", "UserInfo", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
。。。
<input type="file" id="excel" name="excel" style="width:300px"/>
。。。

------------------------------------
Controll里面是
string fileName = Request.Files["excel"].FileName;

本地毫无压力。。但是放在服务器上。进行上传会抛出异常。
数据绑定Excel失败。失败原因:'c:\\...文件路径....'不是一个有效路径。后来发现。那个URL里面除了路径是GB2312的。其他都是UTF-8的。。但是我本身页面都是
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>的怎么整?
[解决办法]
学习学习
MVC3 inputfile 坑爹有关问题

读书人网 >asp.net

热点推荐