diff --git a/src/main/resources/static/js/script.js b/src/main/resources/static/js/script.js index 3917ef6..4f8ace2 100644 --- a/src/main/resources/static/js/script.js +++ b/src/main/resources/static/js/script.js @@ -45,13 +45,14 @@ function deleteSelected() { function validateFile() { const fileInput = document.getElementById('file'); const filePath = fileInput.value; - const allowedExtensions = /(\.mp3|\.mp4|\.mpeg|\.mpga|\.m4a|\.wav|\.webm)$/i; + const allowedExtensions = /(\.mp3|\.mp4|\.mpeg|\.mpga|\.m4a|\.wav|\.webm|\.ogg)$/i; const maxSize = 10 * 1024 * 1024; // 10 MB if (!allowedExtensions.exec(filePath)) { - alert('Invalid file type. Please upload an audio file (mp3, mp4, mpeg, mpga, m4a, wav, webm).'); - fileInput.value = ''; - return false; + alert('File type is not one of the recommended types. We recommend using MP3, MP4, MPEG, MPGA, M4A, WAV, WEBM, OGG.\n' + + 'We can not guarantee that other file types will work as expected.'); + fileInput.value = filePath; + return true; } return true; diff --git a/src/main/resources/templates/file-management.html b/src/main/resources/templates/file-management.html index 66ef4c5..d592c75 100644 --- a/src/main/resources/templates/file-management.html +++ b/src/main/resources/templates/file-management.html @@ -35,7 +35,7 @@ <div class="mb-3"> <label for="file" class="form-label">Choose File</label> <input type="file" id="file" name="file" class="form-control" required - accept=".mp3,.mp4,.mpeg,.mpga,.m4a,.wav,.webm" onchange="validateFile()"> + accept=".mp3,.mp4,.mpeg,.mpga,.m4a,.wav,.webm,.ogg" onchange="validateFile()"> </div> <div class="mb-3"> <label for="language" class="form-label">Select Language</label>