SFULibrary / islandora_datastream_crud

Islandora Drush module for performing Create, Read, Update, and Delete operations on datastreams.
GNU General Public License v3.0
15 stars 15 forks source link

When MIME type is image/tif the file gets a .bin extension with CRUD #95

Open dara2 opened 9 months ago

dara2 commented 9 months ago

I am finding that when I use the following command on an i7 site to batch OBJs for a group of objects, files that have ".tif" as the extension and MIME type image/tif are getting batched as .bin files that do not open. If I simply rename the file to have a .tiff extension, it opens fine. Is there a setting somewhere to which I can add "tif" as an acceptable extension for OBJ files?

Command I'm using:

drush islandora_datastream_crud_fetch_datastreams -u 1 --pid_file=pid_list.txt --dsid=OBJ --datastreams_directory=/islandora/exports/batch4

Here's what the file looks like in i7 manage datastreams tab: Screenshot 2023-09-13 at 12 26 12 PM

bradspry commented 1 month ago

This tool is dependent on Drupal's mime-types definitions, located at: /$your_drupal_path/includes/file.mimetypes.inc

Inside the file you will see mime-types with their associated file extensions.

I had the same issue with WAV files exporting as .bin. Inside of file.mimetypes.inc, I found WAV listed under "audio/x-wav". I updated the definition to Islandora's "audio/vnd.wave" which already used the proper WAV file extension. Clearing Drupal's cache will refresh the definitions and from then forward, files will export with their proper file extensions.

However, be cogent when updating Drupal because file.mimetypes.inc often gets updated and your change will regress.