N
N
NarkoMan012021-02-28 21:37:55
JavaScript
NarkoMan01, 2021-02-28 21:37:55

How to upload file without input?

Good evening! I would like to know how you can download a file when you click on an element that is not associated with the input file.
For example

const fromCd = document.createElement('li');
            fromCd.addEventListener('click',( )=>{
           // Здесь как то нужно получить файл через js
})

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2021-02-28
@NarkoMan01

It's quite simple, hide an invisible input on the page and click it with JavaScript when the user clicks on some other element you designate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question