innostudio / fileuploader

Beautiful and powerful HTML file uploading tool. A jQuery, PHP and Node.js plugin that transforms the standard input into a revolutionary and fancy field on your page.
141 stars 25 forks source link

Uncaught TypeError: Cannot read property 'getTime' of undefined #42

Closed Tiththa closed 5 years ago

Tiththa commented 5 years ago

I am using fileuploader plugin for laravel and ajax method.The files are passed and response is okay, but i am getting this Uncaught TypeError: Cannot read property 'getTime' of undefined and the files are not saved according to the example in the documentation.

innostudio commented 5 years ago

@Tiththa may I know which version are you using and the line in code that triggers this error?

Tiththa commented 5 years ago

@innostudio I am using version 2.2 and laravel 5.6 . i am passing the files with upload method ajax call

upload: {
            url: 'create-listing/images-upload/fileuploader',
            data: null,
            type: 'POST',
            enctype: 'multipart/form-data',
            start: true,
            synchron: true,            
            onSuccess: function(data, item, listEl, parentEl, newInputEl, inputEl, textStatus, jqXHR) {
                item.html.find('.fileuploader-action-remove').addClass('fileuploader-action-success');
                console.log(data);
                // alert(data.success);

                setTimeout(function() {
                    item.html.find('.progress-bar2').fadeOut(400);
                }, 400);
            },

and in the controller

$FileUploader = new FileUploader('files', array(
          // options
          'limit' => null,
          'uploadDir' => storage_path('app/public/images'),
          'title' => 'name'
        ));

        // upload
        $upload = $FileUploader->upload();

        return response()->json(['success' => $upload]);

and in the console of my page i am getting this error and image warnings. https://ibb.co/wYZp72s and the images are getting saved

innostudio commented 5 years ago

@Tiththa can you update the jquery.fileuploader.min.js again?

Tiththa commented 5 years ago

@innostudio i updated and still the same. It now gives a TypeError: c is undefined on firefox.i checked with opera browser it gives the same previous error

TypeError: c is undefined jquery.fileuploader.min.js:8:44044
    jQuery 6
        progressHandling
        success
        u
        fireWith
        k
        n

h=((new Date).getTime()-c.getTime()) with the debugger.

innostudio commented 5 years ago

@Tiththa Please contact us over live chat - https://innostudio.de/fileuploader/documentation/#chatra

Tiththa commented 5 years ago

@innostudio Thanks will do