File upload extention

The file upload component has the option to get the file type but I was hoping to just get the file extention.

When I upload a word document (docx) the file type is: application/vnd.openxmlformats-officedocument.wordprocessingml.document

I would only like to save the extention .docx

Is this possible?

Get the name returned by the file upload, split by . and get the second part:

upload.name.split('.')[1]

this will return docx

2 Likes

Thank you Teodor!