MIME decode: Content-Type ext for other unnamed parts
Posted: 2018-06-12, 16:30 UTC
I think it's also possible to use Content-Type declared for other MIME types, when dealing with unnamed files, f.e.ghisler(Author) wrote:30.05.18 Release Total Commander 9.20 beta 5 (32/64)
(...)
29.05.18 Added: Decoding of MIME files where the name wasn't given -> use .txt extension for TEXT/PLAIN fields, and .htm for TEXT/HTML instead of .bin (32/64)
* Content-Type: image/jpeg – add jpeg extension
* Content-Type: text/css – add css extension
* Content-Type: application/epub+zip – add epub extension
etc.
Current list of media types is available at IANA site here: https://www.iana.org/assignments/media-types/media-types.xhtml
The list is very long and contains many exotic types so I don't think it should be fully supported. Some most common types (f.e. image/jpeg, image/png, image/gif) can be hardcoded like text/plain and text/html now, but the best solution is to keep media type list available for user editing.
It may be a separate list or a part of wincmd.ini, something like:
Code: Select all
[MediaTypes]
txt=text/plain
html=txt/html
jpeg=image/jpeg
png=image/png
epub=application/epub+zip
dat=unsupported