How can I add the file path to the array, for example via input type = 'file'?

  • 0
    Hello everyone!! I need an array with photo paths, how can I add them? Can this be done via input type = 'file'?
    JavaScript Nicholas Foley, Apr 7, 2019

  • 1 Answers
  • 0
    As described at :

    <img id="testImage">
    <input type="file" onchange="readFile(this)">

    function readFile(input) {
    let reader = new FileReader();
    reader.onload = function() {
    document.getElementById('testImage').src = reader.result;
    Lilly Wood

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!