V
V
vladosgala2020-10-28 01:37:48
HTML
vladosgala, 2020-10-28 01:37:48

FileList does not see a file from a field of type file. What to do?

JS:
document.getElementById('create_company_btn').addEventListener("click", function() {

const FileInput = document.getElementById("id_photo");
console.log(FileInput.files);

}, false);

HTML:

, or rather it outputs FileInput.
5f98a201bd5b6535560658.png

And when you click on create_company_btn, an empty FileList array is written to the console.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question