jquery ajaxSubmit is not uploading file although its submitting form

31 Views Asked by At
$(document).on('beforeSubmit','#notes-comments-form',function(e){
e.preventDefault(); //STOP default action
var url = $(this).attr('action'); 
$(this).ajaxSubmit({
    url: url,
    type: 'POST',
    dataType:"JSON",
    success: function(data) {
        if(data.status === 1){
            $('#main-body-leftpanel').html(data.details);
        } 
    }
}); 
return false;

});

I've added jquery.form.js and created form and using one input file tag and upon submitting it's only showing me temp path and not uploading file details..

It suppose to be uploading file as I ready done that but this time it's not working.

If anybody know how to upload file using Ajax please let me know

Thanks, Ali.

0

There are 0 best solutions below