title: File upload pause, show modal window, continue uploading
body: <p>I would like to pause file uploading, show file requirements and then continue.
  Example: user clicks on &quot;upload file&quot;, I show him a modal window with details about the file he is supposed to upload, he clicks ok, then I show him the pop up window to select a file from his computer.</p>
  <p>The problem is that when he gets to a second upload input, browser opens a window to select a file, which it assigns to the first input and immediately opens another window to select a second file. So on the 4th input the user has to select 3 files he's already chosen and then finally the fourth one.</p>
  <p>The trigger function always goes through all of my inputs.</p>
  <p>I tried ev.stopPropagation, $(this).off('click'), return false, etc. Either I put it in a wrong place or it does not solve my problem. I even tried using <code>$('#add-office input[type=&quot;file&quot;]').each() and then $(this).on('click').</code></p>
  <p>Here's my code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/* Jquery */
  
  var warning = false;
  $('#add-office input[type="file"]').on('click', function(e) {
    if (warning) {
      warning = false;
      return;
    }
    e.preventDefault();
  
    $('#files-info-wrapper').show();
    $('#confirm').on('click', (ev) =&gt; {
      ev.preventDefault();
      $('#files-info-wrapper').hide();
      warning = true;
  
      $(this).trigger('click');
  
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>span{
  display:block;
  }
  
  #files-info-wrapper{
  display: none;
  height:150px;
  width:200px;
  background: blue;
  color: white;
  position: absolute;
  top:50%;
  left:50%;
  transform: translate(-50%,-50%);
  text-align:center;
  }
  #confirm{
  color:white;}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!-- HTML --&gt;
  
  &lt;div id="add-office"&gt;
  &lt;span&gt;Logo&lt;/span&gt;
      &lt;input type="file" name="logo" accept="image/x-png,image/gif,image/jpeg"&gt;&lt;/span&gt;
  &lt;span&gt;Cover photo&lt;/span&gt;
      &lt;input type="file" name="cover_photo" accept="image/x-png,image/gif,image/jpeg"&gt;&lt;/span&gt;
  &lt;span&gt;To download&lt;/span&gt;
      &lt;input type="file" name="files[]" accept=".pdf,.doc,.docx" multiple&gt;&lt;/span&gt;
  &lt;span&gt;Gallery&lt;/span&gt;
      &lt;input type="file" name="photos[]" accept="image/x-png,image/gif,image/jpeg" multiple&gt;
      &lt;/div&gt;
      
      &lt;div id="files-info-wrapper"&gt;
      &lt;p&gt;Requirements&lt;/p&gt;
      &lt;p&gt;Your file must be max 2MB&lt;/p&gt;
      &lt;a href="#" id="confirm"&gt;Okay&lt;/a&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Thanks for help</p>