% const getMediaType = (filename) => { const ext = filename.slice(((filename.lastIndexOf(".") - 2) >>> 0) + 2).toLowerCase(); const videoExts = ['.mp4', '.mov', '.avi', '.flv', '.mkv', '.wmv', '.webm']; const imageExts = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.tiff', '.webp']; if (videoExts.includes(ext)) return 'video'; if (imageExts.includes(ext)) return 'image'; return 'other'; }; function sanitizeId(filename) { return filename.replace(/[^a-z0-9]/gi, '_'); } %> <% files.forEach(function(file) { %>
<%= file.path.split('.').pop().toUpperCase() %> file
<% if(user.username === "admin" && file.username !== "admin") { %> <% } %>