jquery-form/form

Upload Progress doesn't perform as expected

handhikadj opened this issue · 2 comments

Description:

I have excel file upload function. The main problem is the uploadProgress doesn't show its progress as it should be. With the current upload progress state, my website just looks static when uploading excel file. How do I do to fix it? By the way, I run my website locally.

Expected Behavior:

The Upload Progress's showing its progress well. And as soon as it's done, it throws the success function

Actual behavior:

It's just an instant from 0 to 100% progress, doesn't indicate there's upload progress on my website. The upload progress just straightaway to 100% before the server is running an upload process, it's not concurrent. Anyway after my website is successfully ran the upload progress, it throws the success function.

Versions:

jQuery v1.9.1
jQuery Form v4.2.2

Code:

    fileInput.on('change', function(event){
            $("#for-loader-excel").addClass("for-loading-excel")
           
            var get_id = $("#get-id-excel").val()
            $("#excel-questions-form").ajaxForm({
                data: {'hidden-excel': get_id},
                uploadProgress: function(event, position, total, percentComplete) {
                    $("#for-loader-excel").css("width", percentComplete + "%")
                }, <-- this shows just a blinking of an eye
                success: function(response) {
                    var response = JSON.parse(response)
                    if (!response.success) {
                        $.jGrowl(response.message, { header: 'Failed Uploading', life: 5000 })
                    } else location.reload()
                },
                error: function(response) {
                    alert("Error Is Occured")
                }
            }).submit();
        });

I have added the "help wanted" label to this issue. I, personally, have never used the file upload feature, so I'm not at all familiar with it. I'm hoping someone from the community will submit a pull request to resolve the issue. I am very open and responsive to pull requests.

this issue's been solved on last year. it works on hosted services, but not working on localhost by the way. thank you for replying this comment