Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Files array ONLY on completion of single file upload (filebatchuploadcomplete event) #193

Closed
beningreenjam opened this issue Mar 10, 2015 · 1 comment
Labels

Comments

@beningreenjam
Copy link

Hi,

I'm currently experiencing an issue where, in my filebatchuploadcomplete event handler and on completion of a batch upload of just one file, the Files variable is an empty array; whereas after completion of a batch upload of multiple files I get an array of Files objects of the successfully uploaded files.

I've switched the event type to fileuploaded, which does show all of them as expected, in both cases of singular and multiple file uploads.

    $('input[type="file"]').fileinput({
        showCaption: false,
        previewFileType: 'any',
        maxFileSize: 10240,
        uploadUrl: "/claims/make-a-claim/motor-fleet-claims/claim-online/supporting-docs/upload",
        uploadExtraData: {
            _token: $('input[name="_token"]').val()
        },
        previewFileIcon: '',
        showRemove: false,
        showUpload: false,
        browseIcon: '<span class="icb-group-icon-folder-open"></span>'
    }).on('fileloaded, filebatchselected', function() {
        $('form').find('input[type="submit"]').prop('disabled', true);
        $('input[type="file"]').fileinput('upload');
    }).on('fileuploaded', function(event, data, previewId, index) {
        console.log(event);
        console.log(data);
        console.log(previewId);
        console.log(index);
    }).on('fileselectnone, filereset, fileuploaded', function() {
        $('form').find('input[type="submit"]').prop('disabled', false);
    });
@sunnymumbai25
Copy link

How to form submission event bind with this input field and data. After manual form submission data do not bind with files input.
Please provide some reference link if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants