diff --git a/public/favicon-32x32.svg b/public/favicon-32x32.svg new file mode 100644 index 0000000..f604fc5 --- /dev/null +++ b/public/favicon-32x32.svg @@ -0,0 +1,38 @@ + diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..8a07f50 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,32 @@ + diff --git a/public/images/favicon.svg b/public/images/favicon.svg new file mode 100644 index 0000000..f604fc5 --- /dev/null +++ b/public/images/favicon.svg @@ -0,0 +1,38 @@ + diff --git a/public/js/main.js b/public/js/main.js index 0667f63..9906645 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -53,9 +53,60 @@ function initializeFileUpload() { function showFileInfo(file) { if (fileName && fileSize && fileInfo) { - fileName.textContent = file.name; - fileSize.textContent = `(${formatFileSize(file.size)})`; + // Define allowed file types for client-side validation + const allowedExtensions = ['.pdf', '.txt', '.doc', '.docx', '.xlsx', '.xls', '.md', '.json', '.csv', '.xml']; + const allowedMimeTypes = [ + 'application/pdf', + 'text/plain', + 'text/markdown', + 'text/csv', + 'text/xml', + 'application/xml', + 'application/json', + 'application/msword', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.ms-excel', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ]; + + // Get file extension + const fileExtension = '.' + file.name.split('.').pop().toLowerCase(); + const fileMimeType = file.type.toLowerCase(); + + // Check if file type is allowed + const isExtensionAllowed = allowedExtensions.includes(fileExtension); + const isMimeTypeAllowed = allowedMimeTypes.includes(fileMimeType) || fileMimeType === ''; + + if (!isExtensionAllowed) { + // Show error for invalid file type + fileInfo.innerHTML = ` +