Code:

<body onload="myFunction()"> <input type="file" id="myFile" multiple size="50" onchange="myFunction()"> <p id="demo"></p> <script> function myFunction(){ var x = document.getElementById("myFile"); var txt = ""; if ('files' in x) { if (x.files.length == 0) { txt = "Select one or more files."; } else { for (var i = 0; i < x.files.length; i++) { txt += "<br><strong>" + (i+1) + ". file</strong><br>"; var file = x.files[i]; if ('name' in file) { txt += "name: " + file.name + "<br>"; } if ('size' in file) { txt += "size: " + file.size + " bytes <br>"; } } } } else { if (x.value == "") { txt += "Select one or more files."; } else { txt += "The files property is not supported by your browser!"; txt += "<br>The path of the selected file: " + x.value; // If the browser does not support the files property, it will return the path of the selected file instead. } } document.getElementById("demo").innerHTML = txt; } </script> <p><strong>Tip:</strong> Use the Control or the Shift key to select multiple files.</p> 

javascript file download

  • Use a four space indent or the {} key to format the code. - AivanF.
  • What does "where does it mean" mean? "When loading" where? - Gikas
  • @Gikas then means where the file is saved in the browser when you pass it through a form that is not understandable? - Vasily Barbashev
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky
  • The question is removed. Here is the source file. drive.google.com/open?id=0B5jig5E9hRMwYUowemNiZkdqWms - Ryslandeveloper

2 answers 2

The browser itself is responsible for this, and it stores it in memory (cache) or in the temp directory. This technology gave us: File API appeared in HTML5 . The ability to view data about the file before sending it to the server.

Here is some good documentation about this. A large number of examples on how to select files, how to implement the drag & drop function, and much more.