Good day!
Actually how to get all the data about the file that is currently in the input field? Particularly interested in getting a base64 image. I would be grateful if someone would give a link to the documentation or explain.
Good day!
Actually how to get all the data about the file that is currently in the input field? Particularly interested in getting a base64 image. I would be grateful if someone would give a link to the documentation or explain.
https://www.google.com/search?q=File+API - a bunch of information on this topic
var el = document.getElementById('input'); el.addEventListener('change', function (){ var files = el.files; // список выбранных файлов files.forEach(function (file){ console.log(file); // https://developer.mozilla.org/en-US/docs/Web/API/File var Reader = new FileReader; Reader.onload = function (evt){ console.log(evt.result); // DataURL }; Reader.readAsDataURL(file); }); }, false);
Source: https://ru.stackoverflow.com/questions/292404/
All Articles