0

I have this ajax code for uploading an image. Everything is working fine but the uploadProgress: function is not working.

$('#imageuploadform').on('submit',(function(e) {

        e.preventDefault();
        var formData = new FormData(this);

        $.ajax({
            type:'POST',
            url: 'tools/image',
            data:formData,
            cache:false,
            contentType: false,
            processData: false,
            success:function(data){
                //console.log("success");
                console.log(data);
                //alert(data);
            },
            uploadProgress: function(event, position, total, percentComplete) {
                console.log(position);

            },
            error: function(data){
                //alert('error');
                //console.log("error");
                console.log(data);
            }
        });
    }));
Eskinder
  • 1,259
  • 12
  • 22

0 Answers0