title: Attach file in php and inserting in a database
body: <p>this is a normal HTML method of attaching a file.</p>
  <p>form enctype=<code>&lt;&quot;multipart/form-data&quot; action=&quot;savefile.php&quot; method=&quot;POST&quot; name=&quot;myform&quot;&gt;</code></p>
  <p>Send this file:</p>
  <pre><code> input name=&quot;myfile&quot; type=&quot;file&quot; onchange=&quot;document.forms['myform'].submit() ;&quot; 
              
  &lt;/form&gt; 
  </code></pre>
  <p><strong>savefile.php</strong></p>
  <pre><code>move_uploaded_file($_FILES[&quot;myfile&quot;][&quot;tmp_name&quot;],
  
  &quot;upload/&quot; . $_FILES[&quot;myfile&quot;][&quot;name&quot;]);
  
  echo &quot;Stored in: &quot; . &quot;upload/&quot; . $_FILES[&quot;myfile&quot;][&quot;name&quot;];
  </code></pre>
  <p>it works perfectly, my difficulty is that when I attach a file and it sends when I refresh the page, the file I attached still remains in the attachment,  how can I clear it so it shows &quot;No chosen file&quot;</p>