This is my code for invoking the FileAPI, to upload images to the client.
//Import SVG does not use click triggers as other functions do.
var file = document.getElementById('tool-importSVG');
file.addEventListener('click', function (event) {
var files = event.target.files;
for (var i = 0; i < files.length; i++) {
var file = files[i];
if (file.type.match('svg')) {
project.importSVG(file, function(item) {
console.log(item);
});
}
}
});
//End of SVG import
and this is the HTML
<li><a href="#" id="tool-importSVG" >Import SVG</a></li>
Is there a way to use a BUTTON instead to invoke the FileAPI? E.g a Bootstrap button.