jquery - Success function not executing in ajax while using ashx hanler -


i uploading data , image using ashx handler , working fine.

but success function in ajax not getting executed

see here:

  $.ajax({                 type: "post",                 url: "../scripts/uploadify/uploadhandler.ashx",                 contenttype: false,                 processdata: false,                 data: imag,                 success: function(data){                     console.log(data.bb);                     alert('hii');                 }              }); 

ashx:

       public void processrequest(httpcontext context)          {            httppostedfile postedfile = context.request.files[0];         if (!(postedfile == null))          {            |            |            }             context.response.contenttype = "application/json";             string bb = postedfile.filename;             context.response.write(bb); //im getting bb name correctly suppose 'koyla.jpg'             context.response.statuscode = 200;         }         public bool isreusable         {                     {         return false;             }         } 

im not getting bb in success function , alert not executing..???

update:

       var fileupload = $("#image").get(0);             var files = fileupload.files;              var imag = new formdata();             (var = 0; < files.length; i++) {                 imag.append(files[i].name, files[i]);                 imag.append('data',json.stringify({ objent: args }));              } 


Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

C# random value from dictionary and tuple -

algorithm - Testing tetrahedron-triangle intersection -