freemium's avatar

dropzone timeout 30 sec


<script>
    var dropzone = new Dropzone('#uploadFile', {
            previewTemplate: document.querySelector('#preview-template').innerHTML,
            parallelUploads: 5,
            thumbnailHeight: 120,
            thumbnailWidth: 120,
            maxFilesize: 1000,
            filesizeBase: 1500,
            uploadMultiple: true,
            timeout: 1800000,

            thumbnail: function(file, dataUrl) {
                if (file.previewElement) {
                    file.previewElement.classList.remove("dz-file-preview");
                    var images = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
                    for (var i = 0; i < images.length; i++) {
                        var thumbnailElement = images[i];
                        thumbnailElement.alt = file.name;
                        thumbnailElement.src = dataUrl;
                    }
                    setTimeout(function() {
                        file.previewElement.classList.add("dz-image-preview");
                    }, 1);
                }
            }
        });

        var minSteps = 6,
            maxSteps = 60,
            timeBetweenSteps = 100,
            bytesPerStep = 100000;

        dropzone.uploadFiles = function(files) {
            var self = this;

            for (var i = 0; i < files.length; i++) {

                var file = files[i];
                totalSteps = Math.round(Math.min(maxSteps, Math.max(minSteps, file.size / bytesPerStep)));

                for (var step = 0; step < totalSteps; step++) {
                    var duration = timeBetweenSteps * (step + 1);
                    setTimeout(function(file, totalSteps, step) {
                        return function() {
                            file.upload = {
                                progress: 100 * (step + 1) / totalSteps,
                                total: file.size,
                                bytesSent: (step + 1) * file.size / totalSteps
                            };

                            self.emit('uploadprogress', file, file.upload.progress, file.upload
                                .bytesSent);
                            if (file.upload.progress == 100) {
                                file.status = Dropzone.SUCCESS;
                                self.emit("success", file, 'success', null);
                                self.emit("complete", file);
                                self.processQueue();
                            }
                        };
                    }(file, totalSteps, step), duration);
                }
            }
        }
</script>

when uploading small video file it gets uploaded when i upload large file more than 50 mb it says request time out after 30 sec i kept timeout: 1800000, but it didn't work

how can i fix that

0 likes
9 replies
Sinnbeck's avatar

Fix what? Did you forget to write about the problem?

furqanDev's avatar

What is the problem and what is it that you want solved ?

Snapey's avatar

timeout of 0 means no timeout, but I doubt it will make a difference

have you adjusted the max post size and the max upload size on the php side?

Have you considered chunking ?

freemium's avatar

@Snapey there is no limit on set on validation ....no chunking is considered

Snapey's avatar

@freemium What? Your reply makes no sense.

I am saying with files of that size you should consider chunking

freemium's avatar

@Snapey @freemium here is my controller code

         $fileName = $request->file->store('recording-videos', 'public');
         $opdcard->images()->create(['imagefile' => $fileName, 'type' => 'recording']);
         return response()->json(['success' => $fileName]);

php ini file is already configured to 1000mb can you help me to resolve this sir...

Please or to participate in this conversation.