Error with Uploadifive

1.7k Views Asked by At

I'm using the HTML5 version of , called .

I'm following the instructions to the letter and I'm getting the following error message:

Uncaught TypeError: Cannot read property 'addEventListener' of undefined

I'm using the latest version of Chrome.

<?php $timestamp = time();?>
    $(function() {
        $('#file_upload').uploadifive({
            'auto'             : false,
            'checkScript'      : 'check-exists.php',
            'formData'         : {
                'timestamp' : '<?php echo $timestamp;?>',
                'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
            },
            'queueID'          : 'queue',
            'uploadScript'     : '<?php echo base_url('/Kb/upload_file'); ?>',
            'onUploadComplete' : function(file, data) { console.log(data); console.log(file); }
        });
    });

When I use the non-minified version I track the error message to line 631 of the uploadifive.js script:

$dropTarget.addEventListener('dragleave', function(e) {
    // Stop FireFox from opening the dropped file(s)
    e.preventDefault();
    e.stopPropagation();
}, false);

Any thought?

1

There are 1 best solutions below

0
On

The option 'queueID' needs to reference a DOM element on page if 'dnd' is set to true.

$('#file_upload').uploadifive({
  auto : false,
  queueID : 'queue',
  dnd: true
});