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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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