Raise audio upload limit to 2 GB per file.
Update validation, dropzone checks, Docker PHP ini, and docs so multi-hour recordings can be uploaded.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
* before submitting the form.
|
||||
*/
|
||||
|
||||
const MAX_FILE_BYTES = 2 * 1024 * 1024 * 1024;
|
||||
|
||||
export function uploadDropzone({ existingFingerprints = [] } = {}) {
|
||||
const acceptExt = ['.mp3', '.wav', '.ogg', '.oga', '.flac', '.m4a', '.mp4', '.aac', '.webm', '.wma', '.aiff', '.aif'];
|
||||
const known = new Set(existingFingerprints);
|
||||
@@ -50,7 +52,7 @@ export function uploadDropzone({ existingFingerprints = [] } = {}) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file.size > 100 * 1024 * 1024) {
|
||||
if (file.size > MAX_FILE_BYTES) {
|
||||
skippedTooLarge++;
|
||||
continue;
|
||||
}
|
||||
@@ -80,7 +82,7 @@ export function uploadDropzone({ existingFingerprints = [] } = {}) {
|
||||
if (skippedUnsupported > 0) {
|
||||
this.error = 'Skipped unsupported file type. Use common audio formats only.';
|
||||
} else if (skippedTooLarge > 0) {
|
||||
this.error = 'Skipped a file larger than 100 MB.';
|
||||
this.error = 'Skipped a file larger than 2 GB.';
|
||||
}
|
||||
|
||||
if (skippedDuplicates > 0) {
|
||||
@@ -153,7 +155,11 @@ export function uploadDropzone({ existingFingerprints = [] } = {}) {
|
||||
return (bytes / 1024).toFixed(1) + ' KB';
|
||||
}
|
||||
|
||||
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
|
||||
if (bytes < 1024 * 1024 * 1024) {
|
||||
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
|
||||
}
|
||||
|
||||
return (bytes / (1024 * 1024 * 1024)).toFixed(2) + ' GB';
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user