• Welcome to Simple Machines Community Forum. Please login or sign up.
October 26, 2021, 01:03:41 AM

News:

Wondering if this will always be free?  See why free is better.


SMF 2.0.11 - MIME handling issues - SQL: mime_type varchar too short

Started by schories, May 20, 2016, 05:29:43 AM

Previous topic - Next topic

schories

Part 1 - major issue:

Apparently, as seen in Part 2 below, "mime_type" in SQL table "smf_attachments" with "varchar(20)" is to short. So i changed this in varchar(255). All SQL files affected: install_2-0_mysql.sql , install_2-0_postgresql.sql , install_2-0_sqlite.sql


Part 2 - minor issue:


After upgrading from SMF 1.1.21 to SMF 2.0.11 I had to fix the mime_type entries (as old SMF 1.x.xx wasn't filling them anyway), e.g. for various "Office" document types, so that these can be autmatically opened (instead of being offered as the default application/octet-stream binary download type). So this might be included in the upgrade tool:

UPDATE `smf_attachments` SET `mime_type` = 'application/msword' WHERE `fileext` = 'doc' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/msword' WHERE `fileext` = 'dot' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' WHERE `fileext` = 'docx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' WHERE `fileext` = 'dotx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-word.document.macroEnabled.12' WHERE `fileext` = 'docm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-word.template.macroEnabled.12' WHERE `fileext` = 'dotm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel' WHERE `fileext` = 'xls' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel' WHERE `fileext` = 'xlt' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel' WHERE `fileext` = 'xla' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' WHERE `fileext` = 'xlsx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' WHERE `fileext` = 'xltx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel.sheet.macroEnabled.12' WHERE `fileext` = 'xlsm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel.template.macroEnabled.12' WHERE `fileext` = 'xltm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel.addin.macroEnabled.12' WHERE `fileext` = 'xlam' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' WHERE `fileext` = 'xlsb' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint' WHERE `fileext` = 'ppt' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint' WHERE `fileext` = 'pot' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint' WHERE `fileext` = 'pps' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint' WHERE `fileext` = 'ppa' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' WHERE `fileext` = 'pptx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.presentationml.template' WHERE `fileext` = 'potx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' WHERE `fileext` = 'ppsx' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint.addin.macroEnabled.12' WHERE `fileext` = 'ppam' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' WHERE `fileext` = 'pptm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint.template.macroEnabled.12' WHERE `fileext` = 'potm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' WHERE `fileext` = 'ppsm' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'application/pdf' WHERE `fileext` = 'pdf' AND `mime_type` = '';

Thank you very much for making SMF such an awesome, reliable and free open source software!! :-)

Alexander Schories

Advertisement: