author-tools icon indicating copy to clipboard operation
author-tools copied to clipboard

File type detection rules

Open martinthomson opened this issue 2 years ago • 0 comments

The language on the main page, like "Plain text as .txt", might be read to imply that filename extensions are critical. Would a ".text" file be ignored even if it was submitted as "text/plain"?

It might be enough to say "Plain text (.txt)" or "Markdown (.md, .mkd, or .markdown), in either kramdown-rfc2629 or mmark format".

Ideally, the tool would detect the file type according to some clear, documented rules. I would suggest that Content-Type take precedence over filename, with the filename only being used when the content-type rule is inconclusive. That's two small lookup tables. I would not do content-type sniffing, as that seems unlikely to be necessary.

(The only reason I say that file extension is needed is that Windows still doesn't associate the correct media type with .md files.)

martinthomson avatar Oct 11 '21 07:10 martinthomson