INNER CODE UNIT · JavaScript
createInputFileElement
Keyfactor/signserver-ce · signserver/modules/SignServer-Admin-web/src/main/webapp/resources/community/js/ejbca-common.js:32
var createInputFileElement = function(newElementId, appendToElementId, onUploadFinishedCallback, encoding = "UTF-8") {
if (!window.FileReader) {
return;
}
if (document.getElementById(newElementId)) {
console.log("ejbca.ra.createFileUploadInput: Element '" + newElementId + "' already exists.");
return;
}
if (!document.getElementById(appendToElementId)) {
console.log("ejbca.ra.createFileUploadInput: Element '" + appendToElementId + "' does not exist.");
return;
}
var inputFileElement = document.createElement("input");
inputFileElement.type = "file";
inputFileElement.id = newElementId;
inputFileElement.onchange = function() {
if (inputFileElement.files.length != 0) {