malsup jQuery Form: Upload Progress doesn't perform as expected
I have excel file upload function. The main problem is the uploadProgress doesn't show its progress as it should be. 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. 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.
- 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 + "%")
- },
- 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();
- });