My current challenge involves displaying a preview of attachments. I want to show an IMAGE SVG preview for image attachments and a PDF preview for PDF attachments, both based on their respective base64 formats. For example, I am currently using the split method for images:
v-else-if="(image.split('/')[1].split(';')[0]) === 'png' || 'jpeg' || 'jpg'"
However, when I attach DOCS and PSD files, all I see is:
data:application/octet-stream;base64,OEJQUwABAAAAA
Image Preview
I am struggling to differentiate between doc and PSD files in order to display a proper preview. Any suggestions would be greatly appreciated.