0

$('input[type="file"]').change(function(){
        $('input[type="text"]').val( $(this).val() );
});
<div class="form-group">
      <label for="exampleFormControlFile1">File</label>
      <input type="file" name="documento" class="form-control-file" required>
</div>
<div class="form-group">
      <label for="exampleFormControlInput1">Name File</label>
      <input type="text" name="dpro_filename_scan" class="form-control" required>
</div>

I have this js file but it print C:\fakepath\filename. I need only the filename.

  • Duplicate: https://stackoverflow.com/q/423376/1531971 –  Oct 18 '18 at 16:08
  • 2
    Possible duplicate of [How to get the file name from a full path using JavaScript?](https://stackoverflow.com/questions/423376/how-to-get-the-file-name-from-a-full-path-using-javascript) –  Oct 18 '18 at 16:08

0 Answers0