From 6e27b9e8cb0b82f76ed56a9927e3a332cb0bb39e Mon Sep 17 00:00:00 2001 From: Chneemann Date: Fri, 20 Sep 2024 04:45:52 +0200 Subject: [PATCH] Implement file upload validation (types and size limit) --- .../chat-msg-box/chat-msg-box.component.html | 3 ++- .../chat-msg-box/chat-msg-box.component.ts | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.html b/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.html index 0462f68..e8af880 100644 --- a/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.html +++ b/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.html @@ -25,8 +25,9 @@ name="file" autocomplete="off" style="display: none" - (change)="onFileChange($event)" + (change)="handleFileSelection($event)" multiple + accept=".png,.gif,.jpg,.jpeg,.pdf,.doc,.docx,.mp3,.wav,.mp4,.wmv,.avi" />