Skip to content

Commit

Permalink
JBPM-9942 When try to attach a document the file can not greater than…
Browse files Browse the repository at this point in the history
… 2 MB
  • Loading branch information
bxf12315 committed Feb 11, 2022
1 parent 2b66a86 commit 19551a4
Showing 1 changed file with 11 additions and 8 deletions.
Expand Up @@ -340,15 +340,18 @@ function encodeImageFileAsURL(input) {

var fileReader = new FileReader();

fileReader.onload = function(fileLoadedEvent) {
var local = fileLoadedEvent.target.result; // <--- data: base64
var srcData = local.replace(/^data:.*\/.*;base64,/, "");

fileData.get(input.id).data = srcData;

console.log("Converted Base64 version is " + srcData);
fileReader.onload = function (fileLoadedEvent) {
if (fileReader.readyState == 2) {
var local = fileLoadedEvent.target.result; // <--- data: base64
var srcData = local.replace(/^data:.*\/.*;base64,/, "");

fileData.get(input.id).data = srcData;
fileReader.readAsDataURL(fileToLoad);
console.log("Converted Base64 version is " + srcData);
}
}
fileReader.readAsDataURL(fileToLoad);


} else {
alert("Please select a file");
}
Expand Down

0 comments on commit 19551a4

Please sign in to comment.