How to get response in else part of oncomplete function jquery file upload
alert(responseJSON.imsg);
this is giving undefined error
function UploadFeasibilty() {
var uploader = new qq.FileUploader({
element: document.getElementById("divFeasibiltyRep"),
action: '../Applicant/FileUploadhandler.ashx?flnm=FeasibiltyReport',
allowedExtensions: ['jpg', 'jpeg', 'pdf'],
sizeLimit: 1024000,
template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
'<div class="qq-upload-button" width="100px">Upload Feasibility Report</div>' +
'<div class="qq-upload-list"></div>' +
'</div>',
onComplete: function (id, fileName, responseJSON) {
debugger;
if (responseJSON.success == true) {
$("#<%= successmsgFeasibiltyRep.ClientID %>").text("Uploaded Successfully!");
$("#<%= hdnFeasibiltyReppath.ClientID%>").val(responseJSON.path);
$("#<%= hplFeasibiltyRep.ClientID%>").text("View File");
$("#<%= hplFeasibiltyRep.ClientID%>").attr("href", responseJSON.path.replace("~/", "../"));
}
else {
console.log(responseJSON);
alert(responseJSON.imsg);
}
},
error: function (e) {
console.log(e);
},
debug: true
});
}
if (count > 1)
{
context.Response.Write("{success:false, imsg:\"Double extension are not allowed in File-Name, please rename and try again.\"}");
}
if (indexOf != -1)
{
context.Response.Write("{success:false, imsg:\"Special character are not allowed in File-Name, please rename and try again.\"}");
}