title: fetch name of file/image uploaded
body: <p>I have a form which has file upload input</p>
  
  <pre><code>&lt;form action="abc.php" method="post"&gt;
     &lt;input name="fileToUpload" type="file" /&gt;
     &lt;div id="view"&gt;&lt;/div&gt;
     &lt;button type="submit" value="submit" name="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I wish to fetch the name of the file/image uploaded on click of this input and display it under <code>&lt;div id="view"&gt;&lt;/div&gt;</code>, but this needs to be done before the form submission. can anyone please tell how this can be done</p>