首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

uploadify的HTTP 500 error

2012-07-31 
求助uploadify的HTTP 500 error我的uploadifyV3.1本地测试OK,上传到服务器就报http 500 error.麻烦指导一

求助uploadify的HTTP 500 error
我的uploadifyV3.1本地测试OK,上传到服务器就报http 500 error.
麻烦指导一下。谢谢!

处理端的ashx代码如下:
 public void ProcessRequest (HttpContext context) {
  context.Response.ContentType = "text/plain";
  context.Response.Charset = "utf-8";
  string ssk = context.Request.Form["ssk"]; //获得一个自定义参数
  HttpPostedFile file = context.Request.Files["Filedata"];
  string uploadPath = HttpContext.Current.Server.MapPath("../images/");

  if (file != null)
  {
  if (!Directory.Exists(uploadPath))
  {
  Directory.CreateDirectory(uploadPath);
  }
  //file.SaveAs(uploadPath + file.FileName);
  //string strimg = uploadPath + Session["user_id"].ToString().Trim()+".jpg";
   
  file.SaveAs(uploadPath + ssk+".jpg");
  context.Response.Write("1");
  }
  else
  {
  context.Response.Write("0");
  }  

  }

[解决办法]
你要保存的文件夹是否添加了读写权限
[解决办法]

探讨

召唤各路能人,包括somethingjack等等。

[解决办法]
你打印出详细的错误信息一看就明白了
另外
HttpContext.Current.Server.MapPath("../images/")
最好写成
HttpContext.Current.Server.MapPath("~/images/")

热点排行