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 we only check file endings (like docx) to verify if a file is of a current type. This sould better be handled by checking it's mime type.
Meanwhile used method to check file endings: CRM_Civioffice_MimeType::hasSpecificFileNameExtension($file_name, CRM_Civioffice_MimeType::DOCX)
Approach
mime_content_type() can be used to check the mime type of a file.
Problems with this approach:
mime_content_type() is unable to access uploaded files as they are in a temp folder probalby somewhere in apache. The folder (/tmp/phpHNHdUd/) where this file should be doesn't exist. However move_uploaded_file() can access/move it
Besides the docx mimetype, this method also returns application/octet-stream or application/zip for only some files tested. We don't want to exclude these files, as they do work with our currently used unoconv converter
The text was updated successfully, but these errors were encountered:
General
Currently we only check file endings (like docx) to verify if a file is of a current type. This sould better be handled by checking it's mime type.
Meanwhile used method to check file endings:
CRM_Civioffice_MimeType::hasSpecificFileNameExtension($file_name, CRM_Civioffice_MimeType::DOCX)
Approach
mime_content_type()
can be used to check the mime type of a file.Problems with this approach:
mime_content_type()
is unable to access uploaded files as they are in a temp folder probalby somewhere in apache. The folder (/tmp/phpHNHdUd/
) where this file should be doesn't exist. Howevermove_uploaded_file()
can access/move itapplication/octet-stream
orapplication/zip
for only some files tested. We don't want to exclude these files, as they do work with our currently used unoconv converterThe text was updated successfully, but these errors were encountered: