feature/IO-2282-VSSTA-Integration: - checkpoint
This commit is contained in:
17
server/media/util/determineFileType.js
Normal file
17
server/media/util/determineFileType.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @description Determines the file type based on the filetype string.
|
||||
* @note Also needs to be updated in the mobile app utility.
|
||||
* @param filetype
|
||||
* @returns {string}
|
||||
*/
|
||||
const determineFileType = (filetype) => {
|
||||
if (!filetype) return "auto";
|
||||
else if (filetype.startsWith("image")) return "image";
|
||||
else if (filetype.startsWith("video")) return "video";
|
||||
else if (filetype.startsWith("application/pdf")) return "image";
|
||||
else if (filetype.startsWith("application")) return "raw";
|
||||
|
||||
return "auto";
|
||||
};
|
||||
|
||||
module.exports = determineFileType;
|
||||
Reference in New Issue
Block a user