title: Plupload file upload
body: <p>I have a question about the plupload queue</p>
  
  <p>I want to know where i can put the maximum file upload so i only wants that a user uploads files with a mixmum of 1gb total so by example 10 files of 100mb is total 1gb and after this the user dont cant upload files any</p>
  
  <pre><code>$(document).ready(function () {
  
      $(function () {
          $("#uploader").pluploadQueue({
              runtimes: 'html5, html4',
              url: '/Upload/Upload',
              max_file_size: '1gb',
              unique_names: true,
              multipart: true,
              multiple_queues: false,
              filters: [
                  { title: "Bestanden", extensions: "jpg,gif,png,docx,wmv,xslx,avi" },
              ],
  
              preinit: {
                  FileUploaded: function (up, file, response) {
                      var data = response.response; //$.parseJSON(response.response);
  
                      $('&lt;input&gt;').attr({
                          type: 'hidden',
                          name: 'fileId' + data,
                          value: data
                      }).appendTo('#uploadFinishedForm');
  
                      if (data.error == 1) {
                          uploader.trigger("Error", { message: "'" + data.message + "'", file: file });
                          console.log('[Error] ' + file.id + ' : ' + data.message);
                          return false;
                      }
                  },
  
                  UploadComplete: function (up, files) {
                      window.setTimeout(function (form) {
                   //       $('#uploadFinishedForm').submit();
                          $('.nextButton').append('&lt;input type="submit" class="btn btn-large btn-success submit-btn" value="Transfer" /&gt;');
                      }, 2000)
  
                  },
  
                  Init: function (up, info) {
                      $('#uploader_container').removeAttr("title");
                  }
              }
          });
  
  
          $('#uploadForm').submit(function (e) {
              var uploader = $('#uploader').pluploadQueue();
              if (uploader.files.length &gt; 0) {
                  uploader.bind('StateChanged', function () {
                      if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
                          $('#uploadForm').submit();
                      }
                  });
  
                  uploader.start();
              } else {
                  $('#uploadInfo').html('Zonder foto\'s valt er niets te uploaden!');
              }
  
              return false;
  
  
  
          });
  
          $(".btnDel")
                  .live("click", function () {
                      if ($("tr.person-input-row").length &gt; 1) {
                          if (confirm("Wilt u deze naam wilt verwijderen?")) {
                              $(this).parents("tr.person-input-row").fadeOut("normal", function () { $(this).remove(); refineIndexes(); });
                          }
                      } else {
                          alert("Naam kan niet worden verwijderd.\n\nEr dient minimaal 1 email adres opgegeven te worden.");
                      }
                      return false;
                  });
  
          $("#btnAdd")
                  .live("click", function () {
                      // duplicate a row and force unique element id's
                      var table = $("#participants_list");
                      var tr = table.find('tr:first').next().clone()
                      $(tr).find('input').each(function () {
                          if (this.type === "text") { $(this).val(''); } // clear text
                      });
                      $(tr).appendTo(table);
  
                      refineIndexes();
                  });
  
          function refineIndexes() {
              // function to duplicate a row and update unique element id's
              var index = 0;
              $("#participants_list").find('tr').next().each(function () {
                  $(this).find('input').each(function () {
  
                      var newId = this.id.replace(parseInt(this.id.match(/[\d\.]+/g)[0], null).toString(), index);
                      var newName = this.name.replace(parseInt(this.name.match(/[\d\.]+/g)[0], null).toString(), index);
  
                      // IE7 struggling with 'name' attribute
                      if ($.browser.msie &amp;&amp; $.browser.version.substr(0, 1) &lt;= 7) {
                          // for readability
                          var oldInput = $(this);
  
                          // recreate new input and add to DOM
                          var newInput = $("&lt;input type=\"" + this.type + "\" id=\"" + newId + "\" name=\"" + newName + "\" /&gt;").addClass(oldInput.attr("class")).val(oldInput.val()).insertAfter(oldInput);
  
                          // set checked attribute on radio
                          // remove old input from DOM
                          oldInput.remove();
  
                      } else {
                          $(this).attr({ id: newId, name: newName });
                      }
                  });
  
                  $(this).find('.num').text(function () {
                      var elSpan = $(this).text();
                      var nr = parseInt(elSpan.match(/[\d\.]+/g)[0], null);
                      return elSpan.replace(nr.toString(), index + 1);
                  });
  
                  $(this).find('label').attr('for', function () {
                      elFor = $(this).attr('for');
                      var nr = parseInt(elFor.match(/[\d\.]+/g)[0], null);
                      return elFor.replace(nr.toString(), index);
                  });
                  index++;
              });
  
  
          }
  
  
  
      });
  });
  </code></pre>