当前位置: 代码迷 >> ASP.NET >> uploadify的HTTP 500 error
  详细解决方案

uploadify的HTTP 500 error

热度:2095   发布时间:2013-02-25 00:00:00.0
求助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/")
  相关解决方案