0

I am using dropzone.js, and have it integrated with Laravel. Everything is working as expected. Smaller file sizes upload no problem. But around the 3.5mb threshold, uploads tend to stall out.

A couple of notes:

According to my phpInfo, the following parameters are set as so:

max_execution_time = 60s
max_file_uploads = 20
memory_limit = 128M
post_max_size = 10M
upload_max_filesize = 10M

Additionally, in the initializing JS, I have the maxFileSize set to 25 (full code below).

I also checked with my hosting company, and the NGINX post size is also set to be 25mb.

As previously mentioned, the script and everything seems to be working just fine as long as the files are below ~3.5mb, so I don't necessarily think it's an issue with the script, or permissions. It's just, as soon as it gets to that 3.5mb mark, uploads just stop, and never finish uploading. There's gotta be something, somewhere that is preventing a file from going over that size - but I can't for the life of me figure out what it could be.

Any ideas of what I could be missing?

Dropzone.options.dropzone = {

maxFilesize: 25,
init: function() {
    console.log("Its initialized.");

    this.on("queuecomplete", function (file) {
        console.log(file);
        console.log("All done!");
    });
},

renameFile: function(file) {
    var dt = new Date();
    var time = dt.getTime();
   return time+file.name;
},

acceptedFiles: ".jpeg,.jpg,.png,.gif,.ai,.psd,.pdf,.tiff,.eps,.svg,.xd",
addRemoveLinks: true,
timeout: 5000,
removedfile: function(file) {
    var name = file.upload.filename;

    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $.ajax({
        type: 'POST',
        url: 'logo/delete',
        data: {filename: name},
        success: function (data){
            console.log("File has been successfully removed!!");
            $(".logos-wrapper").empty().append(data);
        },
        error: function(e) {
            console.log(e);
        }});
        var fileRef;
        return (fileRef = file.previewElement) != null ? 
        fileRef.parentNode.removeChild(file.previewElement) : void 0;
},
success: function(file, response) {
    console.log(response);
    var someValue = "";
    $.ajax({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
        },
        type: 'GET',
        url: 'get-logos',
        data: {someValue:someValue},
        success: function (logos){
            $(".logos-wrapper").empty().append(logos);
        },

        error: function(e) {
            console.log(e);
        }
    });

},
error: function(file, response) {
    console.log("There was an error");
   return false;
}
};
John Hubler
  • 877
  • 1
  • 11
  • 27
  • Check this is something related to your issue hope this will help https://stackoverflow.com/questions/17143884/dropzone-js-maxfilesize-increase-not-working – Akhilesh Jul 05 '19 at 16:45
  • Per this suggestion, I went ahead and updated my JS to include a log in the console that showed upload progress. I can verify that the file is uploading to 100% - but isn't getting finalized. So it appears as though there is a problem moving the uploaded file to the final folder. – John Hubler Jul 05 '19 at 16:58

0 Answers0