title: Cannot upload big zip files using drop-zone in CodeIgniter
body: <p>I'm trying to upload zip file using drop zone. Uploading just fine with small size zip files. However, for zip more than 5MB cannot upload. Somehow the uploading process stuck at 100% and remain there until page refresh manually.</p>
  <p><strong>You can see here:</strong></p>
  <p><a href="https://i.stack.imgur.com/a3hBU.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a3hBU.gif" alt="here" /></a></p>
  <p>after dragging the file, at 100% it getting stuck and error come up in the console.</p>
  <p><strong>Error:</strong></p>
  <p><a href="https://i.stack.imgur.com/jLN9c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jLN9c.png" alt="here" /></a></p>
  <p>HTML</p>
  <pre><code>&lt;?php $exts = str_replace('&quot;', '', $this-&gt;product_settings-&gt;digital_allowed_file_extensions);
  $exts = str_replace(',', &quot;, &quot;, $exts);
  $exts = strtoupper($exts); ?&gt;
  &lt;div class=&quot;form-box&quot;&gt;
      &lt;div class=&quot;form-box-head&quot;&gt;
          &lt;h4 class=&quot;title&quot;&gt;
              &lt;?php echo trans('digital_files'); ?&gt;
              &lt;small&gt;&lt;?php echo trans(&quot;allowed_file_extensions&quot;); ?&gt;:&amp;nbsp;&lt;strong class=&quot;font-500&quot;&gt;&lt;?php echo $exts; ?&gt;&lt;/strong&gt;&lt;/small&gt;
          &lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class=&quot;form-box-body&quot;&gt;
          &lt;div class=&quot;row&quot;&gt;
              &lt;div class=&quot;col-sm-12&quot;&gt;
                  &lt;div id=&quot;digital_files_upload_result&quot; class=&quot;row-custom&quot;&gt;
                      &lt;?php $this-&gt;load-&gt;view('dashboard/product/_digital_files_upload_response'); ?&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;error-message error-message-file-upload&quot;&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- File item template --&gt;
  &lt;script type=&quot;text/html&quot; id=&quot;files-template-digital-files&quot;&gt;
      &lt;li class=&quot;media&quot;&gt;
          &lt;div class=&quot;media-body&quot;&gt;
              &lt;div class=&quot;progress&quot;&gt;
                  &lt;div class=&quot;progress-bar&quot; role=&quot;progressbar&quot; style=&quot;width: 0%&quot; aria-valuenow=&quot;0&quot; aria-valuemin=&quot;0&quot; aria-valuemax=&quot;100&quot;&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  &lt;/script&gt;
  </code></pre>
  <p><strong>JS</strong>: library that I'm using here: <a href="https://github.com/danielm/uploader" rel="nofollow noreferrer">https://github.com/danielm/uploader</a></p>
  <pre><code>&lt;script&gt;
      $('#drag-and-drop-zone-digital-files').dmUploader({
          url: '&lt;?php echo base_url(); ?&gt;upload-digital-files-post',
          queue: true,
          extFilter: [&lt;?php echo $this-&gt;product_settings-&gt;digital_allowed_file_extensions;?&gt;],
          multiple: false,
          extraData: function (id) {
              return {
                  &quot;product_id&quot;: &lt;?php echo $product-&gt;id; ?&gt;,
                  &quot;&lt;?php echo $this-&gt;security-&gt;get_csrf_token_name(); ?&gt;&quot;: $.cookie(csfr_cookie_name)
              };
          },
          onDragEnter: function () {
              this.addClass('active');
          },
          onDragLeave: function () {
              this.removeClass('active');
          },
          onNewFile: function (id, file) {
              ui_multi_add_file(id, file, &quot;digital-files&quot;);
          },
          onBeforeUpload: function (id) {
              ui_multi_update_file_progress(id, 0, '', true);
              ui_multi_update_file_status(id, 'uploading', 'Uploading...');
          },
          onUploadProgress: function (id, percent) {
              ui_multi_update_file_progress(id, percent);
          },
          onUploadSuccess: function (id, data) {
              var obj = JSON.parse(data);
              if (obj.result == 1) {
                  document.getElementById(&quot;digital_files_upload_result&quot;).innerHTML = obj.html_content;
              }
          },
          onFileExtError: function (file) {
              $(&quot;.error-message-file-upload&quot;).html(&quot;&lt;?php echo trans('invalid_file_type'); ?&gt;&quot;);
              setTimeout(function () {
                  $(&quot;.error-message-file-upload&quot;).empty();
              }, 4000);
          },
      });
      $(document).ajaxStop(function () {
          $('#drag-and-drop-zone-digital-files').dmUploader({
              url: '&lt;?php echo base_url(); ?&gt;upload-digital-files-post',
              queue: true,
              extFilter: [&lt;?php echo $this-&gt;product_settings-&gt;digital_allowed_file_extensions;?&gt;],
              multiple: false,
              extraData: function (id) {
                  return {
                      &quot;product_id&quot;: &lt;?php echo $product-&gt;id; ?&gt;,
                      &quot;&lt;?php echo $this-&gt;security-&gt;get_csrf_token_name(); ?&gt;&quot;: $.cookie(csfr_cookie_name)
                  };
              },
              onDragEnter: function () {
                  this.addClass('active');
              },
              onDragLeave: function () {
                  this.removeClass('active');
              },
              onNewFile: function (id, file) {
                  ui_multi_add_file(id, file, &quot;digital-files&quot;);
              },
              onBeforeUpload: function (id) {
                  ui_multi_update_file_progress(id, 0, '', true);
                  ui_multi_update_file_status(id, 'uploading', 'Uploading...');
              },
              onUploadProgress: function (id, percent) {
                  ui_multi_update_file_progress(id, percent);
              },
              onUploadSuccess: function (id, data) {
                  var obj = JSON.parse(data);
                  if (obj.result == 1) {
                      document.getElementById(&quot;digital_files_upload_result&quot;).innerHTML = obj.html_content;
                  }
              },
              onFileExtError: function (file) {
                  $(&quot;.error-message-file-upload&quot;).html(&quot;&lt;?php echo trans('invalid_file_type'); ?&gt;&quot;);
                  setTimeout(function () {
                      $(&quot;.error-message-file-upload&quot;).empty();
                  }, 4000);
              },
          });
      });
  &lt;/script&gt;
  </code></pre>
  <p><strong>PHP</strong></p>
  <pre><code>  //upload digital files
      public function upload_digital_files($product_id)
      {
          if (isset($_FILES['file'])) {
              if (empty($_FILES['file']['name'])) {
                  exit();
              }
          }
          $product = $this-&gt;product_model-&gt;get_product_by_id($product_id);
          if (!empty($product)) {
              $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
              $file_name = str_slug($this-&gt;general_settings-&gt;application_name) . &quot;-digital-file-&quot; . $product-&gt;id . uniqid() . &quot;.&quot; . $ext;
              $this-&gt;load-&gt;model('upload_model');
              if ($this-&gt;upload_model-&gt;digital_file_upload('file', $file_name)) {
                  $data = array(
                      'product_id' =&gt; $product_id,
                      'user_id' =&gt; user()-&gt;id,
                      'file_name' =&gt; $file_name,
                      'storage' =&gt; 'local',
                      'created_at' =&gt; date('Y-m-d H:i:s')
                  );
                  @$this-&gt;db-&gt;close();
                  @$this-&gt;db-&gt;initialize();
                  $this-&gt;db-&gt;insert('digital_files', $data);
              }
          }
      }
  
  //digital file upload
      public function digital_file_upload($input_name, $file_name)
      {
          $config['upload_path'] = './uploads/digital-files/';
          $config['allowed_types'] = '*';
          $config['file_name'] = $file_name;
          $this-&gt;load-&gt;library('upload', $config);
  
          if ($this-&gt;upload-&gt;do_upload($input_name)) {
              $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
              if (isset($data['upload_data']['full_path'])) {
                  return true;
              }
              return null;
          } else {
              return null;
          }
      }
  </code></pre>