I am trying to show a preview of attachments like if the user attaches an image preview will show IMAGE SVG, the same as PDF. I am decided preview by their base64 formate e.g for the image I use split method for image:
v-else-if="(image.split('/')[1].split(';')[0]) === 'png' || 'jpeg' || 'jpg'"
When I attach DOCS and PSD file, it shows me
data:application/octet-stream;base64,OEJQUwABAAAAA
Image Preview
How can I differentiate between docs and PSD to show a preview?