Skip to content

Commit

Permalink
skip files on UI upload which are bigger than 500MB (with alert to user)
Browse files Browse the repository at this point in the history
  • Loading branch information
twrichards committed Dec 17, 2024
1 parent d5b7132 commit 4fdf17f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion kahuna/public/js/upload/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ upload.factory('uploadManager',
};
}

async function createJobItems(files){
async function createJobItems(_files){

const filesAboveSizeLimit = _files.filter(file => file.size > 500000000); // 500MB

if (filesAboveSizeLimit.length > 0){
alert(`The following files will be skipped as they are above the size limit of 500MB:\n ${
filesAboveSizeLimit.map(file => file.name).join("\n")
}`);
}

const files = _files.filter(file => file.size <= 500000000); // 500MB

if (window._clientConfig.shouldUploadStraightToBucket) {
const mediaIdToFileMap = Object.fromEntries(
await Promise.all(
Expand Down

0 comments on commit 4fdf17f

Please sign in to comment.