title: How to reset <input type='file' /> in ASP.NET MVC
body: <p>I just checked all options to reset/clean <code>&lt;input type='file' /&gt;</code> based on </p>
  
  <p><a href="https://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery">Clearing &lt;input type=&#39;file&#39; /&gt; using jQuery</a></p>
  
  <p>And all of them are not working.</p>
  
  <p>What I do in my page is submit new file and update page in  a normal way.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form&gt;
   &lt;input type="file" name="file" id="fileUploader" class="btn btn-sm btn-default" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And then I have AJAX link to delete uploaded file. So I delete it in Session and in AJAX callback do like </p>
  
  <pre><code> //Reset
   var uploader = $("#fileUploader");
   window.reset = function (uploader) {
              e.wrap('&lt;form&gt;').closest('form').get(0).reset();
              e.unwrap();
   }
   uploader.reset();
  
   // Clear all file fields:
   // $("input:file").clearInputs();
  
   // Clear also hidden fields:
   //$("input:file").clearInputs(true);
  
   //$row.replaceWith($row = $row.val('').clone(true));
  </code></pre>
  
  <p>But after this when I do F5 / Update  <strong>HttpPost</strong> happens and it has posted file.</p>
  
  <p>How to fix it?</p>
  
  <p><strong>P.S.</strong>
  And even if I do the following no joy...</p>
  
  <pre><code> $('#inputFileForm').html("");
  
                  $('#inputFileForm').append(
                      //  &lt;input type="file" name="file" id="fileUploader" class="btn btn-sm btn-default" /&gt;
                      $('&lt;input/&gt;').attr('type', 'file').attr('name', 'file').class("btn btn-sm btn-default")
             );
  </code></pre>