You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when calling POST /resources, only the mime type of images is automatically detected. PDF for example are not detected, unless they end with the ".pdf" extension.
We should investigate whether we can automatically detect the mime type based on the file signature (there's probably an npm package for this). If the imported package is not too large that would be the preferred solution.
The text was updated successfully, but these errors were encountered:
laurent22
changed the title
set mime type of non-images when creating resources from API
Set mime type of non-images when creating resources from API
Jun 24, 2024
I guess the best package to do that would be file-type, it has a lot of downloads, has only 4 dependencies (and each one has at most 2 dependencies), a pretty extensive list of formats.
Would be interesting to think what are the most common type of format that should be supported, I guess most of the times it will PDF or a document file like Microsfot Word/Excel (which is supported by the package, excluding older versions) and .odf/.ods (Libre/OpenOffice, etc).
Currently, when calling
POST /resources
, only the mime type of images is automatically detected. PDF for example are not detected, unless they end with the ".pdf" extension.We should investigate whether we can automatically detect the mime type based on the file signature (there's probably an npm package for this). If the imported package is not too large that would be the preferred solution.
The text was updated successfully, but these errors were encountered: