Purushoth
Purushoth

Reputation: 2793

First time file not uploading in blueimp Jquery File Upload

I am using Blueimp JqueryFileUpload, when i tried to upload my very first file its not uploading. But After i tried the same file or any file its working.

I can't figure out whats goes wrong for the very first upload.

While debugging i can found that the fileupload method not triggered for the first upload but followed consecutive uploads say second,third,.. its triggering

           $('#fileUpload').fileupload({
                url: 'home/upload',
                dataType: 'json',
                done: function (e, data) {
                   //do something
                }
            });

Upvotes: 0

Views: 1150

Answers (2)

user2622797
user2622797

Reputation: 21

Initialize .fileupload() method after form or form field is generated. like

$('#fileupload'+rowNum).fileupload();

here $('#fileupload'+rowNum) is a dynamic form id.

Upvotes: 2

mattsears18
mattsears18

Reputation: 144

Are you generating the input file field after the page loads? I had the same issue because I forgot to initialize .fileupload() after the input field was appended.

Upvotes: 2

Related Questions