Created
March 24, 2023 09:29
-
-
Save Wildanzr/7dbed9e4d4f4511d5405d6c86fa2bbc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const acceptedFileTypes = [ | |
"image/jpeg", | |
"image/png", | |
"image/svg+xml", | |
"video/mp4", | |
"video/quicktime", | |
"video/webm", | |
"application/pdf", | |
"application/msword", | |
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", | |
"application/vnd.ms-powerpoint", | |
"application/vnd.openxmlformats-officedocument.presentationml.presentation", | |
]; | |
// Membuat fungsi validasi file | |
const validateFileTypes = (file) => { | |
if (!acceptedFileTypes.includes(file.mimetype)) { | |
return false; | |
} | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment