我的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");
}
}
------解决方案--------------------------------------------------------
你要保存的文件夹是否添加了读写权限
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
你打印出详细的错误信息一看就明白了
另外
HttpContext.Current.Server.MapPath("../images/")
最好写成
HttpContext.Current.Server.MapPath("~/images/")