Skip to content

Commit

Permalink
changed: checkAcceptedFile fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Oct 18, 2024
1 parent 03083a7 commit f235104
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/chat21-core/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@ export function checkAcceptedFile(fileType, fileUploadAccept ): boolean{
const baseMimeType = fileType.split('/')[0]; // Ottieni la parte principale del MIME type
return accept.replace('/*', '') === baseMimeType;
}

// Controlla se l'accettazione è un MIME type esatto (come image/jpeg)
if (accept === fileType) {
return true;
}
// Controlla per le estensioni di file specifiche come .pdf o .txt
return fileType === getMimeTypeFromExtension(accept);
});
Expand Down

0 comments on commit f235104

Please sign in to comment.