我们如何通过习俗错误信息来提升负荷?
如果在控制人员的行动上,有一个例外(以尝试/捕获物为选择)——我们如何将其上载文字? 永远不会援引过错误事件?
[HttpPost]
public ActionResult Upload(HttpPostedFileBase fileData, FormCollection forms)
{
try
{
if (fileData.ContentLength > 0)
{
var statusCode = Helper.UploadList();
if (statusCode.Equals(System.Net.HttpStatusCode.Created))
return Json(new { success = true });
}
}
return Json(new { success = false });
}
catch (Exception ex)
{
return Json(new { success = false });
}
}
onComplete : function (event, queueID, fileObj, response, data) {
if (response == {"success":true} ) {
alert("File uploaded successfully.");
}
else if (response == {"success":false} ) {
alert( File failed to upload. Please try again! );
}
else {
$("#file_uploadDomain").uploadifyCancel(queueID);
}
return false;
},
onError : function(event, ID, fileObj, errorObj) {
alert(errorObj.type + Error: + errorObj.info);
},