How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?

后端 未结 11 2888
谎友^
谎友^ 2020-11-21 04:36

How to get full path of file while selecting file using




        
11条回答
  •  耶瑟儿~
    2020-11-21 05:25

    file element has and array call files it contain all necessary stuff you need

    var file = document.getElementById("upload");
    
    file.addEventListener("change", function() {
        for (var i = 0; i < file.files.length; i++) {
            console.log(file.files[i].name);
        }
    }, false);
    

提交回复
热议问题