maximum file count
This commit is contained in:
parent
c78844d8b1
commit
7d8c4f00fa
2 changed files with 15 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
const FILE_CHUNK_SIZE = 16384;
|
||||
const MAX_FILES = 256;
|
||||
|
||||
const fileInputContainer = document.getElementById('file_input_container');
|
||||
const fileInput = document.getElementById('file_input');
|
||||
|
@ -86,6 +87,7 @@ function updateFiles() {
|
|||
uploadButton.textContent = `Upload ${files.length} file${files.length > 1 ? 's' : ''} (${displaySize(totalBytes)})`;
|
||||
uploadButton.style.display = '';
|
||||
}
|
||||
fileInput.disabled = (files.length >= MAX_FILES);
|
||||
}
|
||||
|
||||
updateFiles();
|
||||
|
@ -93,6 +95,7 @@ downloadLinkContainer.style.display = 'none';
|
|||
progressContainer.style.display = 'none';
|
||||
|
||||
function addFile(newFile) {
|
||||
if (files.length >= MAX_FILES) { return; }
|
||||
if (files.some((oldFile) => newFile.name === oldFile.name)) { return; }
|
||||
|
||||
files.push(newFile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue