首页 新闻 会员 周边

uploadify文件上传 io error

0
悬赏园豆:20 [已解决问题] 解决于 2011-04-07 15:58

1 context.Response.ContentType = "text/plain";
2 context.Response.Charset = "utf-8";
3 HttpPostedFile file = context.Request.Files["Filedata"];
4 int i = file.ContentLength;
5 string uploadPath =
6 HttpContext.Current.Server.MapPath(@context.Request["folder"]) + "\\";
7
8 if (file != null)
9 {
10 if (!Directory.Exists(uploadPath))
11 {
12 Directory.CreateDirectory(uploadPath);
13 }
14
15 file.SaveAs(uploadPath + file.FileName);
16 //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
17   context.Response.Write("1");
18 }
19 else
20 {
21 context.Response.Write("0");
22 }

我今天用uploadify写文件上传的功能当我的文件超过5M就提示context.Request.Files["Filedata"];代码超出范围

梅莲芳的主页 梅莲芳 | 小虾三级 | 园豆:669
提问于:2011-03-22 18:47
< >
分享
最佳答案
1

要设置webconfig里面的值

<httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="1048576"
executionTimeout
="3600"/>

收获园豆:20
Macbeth | 初学一级 |园豆:126 | 2011-03-22 20:56
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册