title: Primefaces upload, how to only allow one upload in advance mode
body: <p>I am wondering if it possible, by using the primefaces upload in advance mode to limit the user uploading one file only, currently i have :</p>
  
  <pre><code> &lt;p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
                                    mode="advanced" 
                                    multiple="false" 
                                    update="messages"
                                    sizeLimit="100000000" 
                                    allowTypes="/(\.|\/)(gif|jpe?g|png|doc|docx|txt|pdf)$/"
                                    auto="false"/&gt;
  
  
                      &lt;p:growl id="messages" showDetail="true"/&gt;
  </code></pre>
  
  <p>as you can see i have muliple ="false" but a user is still able to upload multiple files, any tips ?</p>
  
  <p>EDIT :</p>
  
  <pre><code>                &lt;p:fileUpload widgetVar="upload" fileUploadListener="#{fileUploadController.handleFileUpload}"
                                mode="advanced" 
                                multiple="false" 
                                update="messages"
                                label="Select File"
                                sizeLimit="100000000" 
                                allowTypes="/(\.|\/)(gif|jpe?g|png|doc|docx|txt|pdf|html)$/"
                                auto="false"/&gt;
  
  
                  &lt;p:growl id="messages" showDetail="true"/&gt;
  </code></pre>
  
  <p>have added the widgetVar above</p>
  
  <p>and in my js </p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
          function Naviagtion()
          {
              //alert("Sent to the printing holding queue, you may close this app now, your work will still print out ");
              window.setTimeout(afterDelay, 500);
              location.href = 'FilesUploaded.xhtml';
  
          }
  
          upload.buttonBar.find('input[type=file]').change(function() {
              if (this.value) {
                  var files = upload.uploadContent.find('.files tr');
  
                  if (files.length &gt; 1) {
                      files.get(0).remove();
                  }
              }
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>but i am still able to multi upload, am i going about this in the right direction </p>