Details
MIME issues
By Paul
Jul 29, 2015 pm31 2:32 PM (Edited )
A while back, I added some automatic file extension correction code that fixed the extension for files that were named incorrectly. If somebody named a png file as my.jpg, WSN detects that it's actually a png and renames it to my.png so that thumbnails etc work correctly.
Turns out there was an unexpected problem with this. It works fine with images, but other file types have MIME values which can't easily be matched to a file extension. MP3 files can have a MIME type audio/mpeg or x-wav, so WSN was renaming them with .mpeg or .x-wav extensions. The next release of all the active series fixes this problem by restrincting the MIME renaming to only a small whitelisted selection of detected MIME types: JPEG, GIF and PNG files.
Also fixed a 9.1/9.2 bug that was causing files to download with the wrong file name.
By Paul
Jul 29, 2015 pm31 2:32 PM (Edited )
Turns out there was an unexpected problem with this. It works fine with images, but other file types have MIME values which can't easily be matched to a file extension. MP3 files can have a MIME type audio/mpeg or x-wav, so WSN was renaming them with .mpeg or .x-wav extensions. The next release of all the active series fixes this problem by restrincting the MIME renaming to only a small whitelisted selection of detected MIME types: JPEG, GIF and PNG files.
Also fixed a 9.1/9.2 bug that was causing files to download with the wrong file name.
Tags | files, fixes | ||||||
Views | 309 views. Averaging 309 views per day. | ||||||
Similar Listings |
|
Sorry, you don't have permission to post. Log in, or register if you haven't yet.
Please login or register.