tower-web icon indicating copy to clipboard operation
tower-web copied to clipboard

Deducing the content type for files

Open lnicola opened this issue 7 years ago • 2 comments

If we're so inclined, we could read the first bytes of the file and use the mime_sniffer crate to and pick a content type automatically.

Alternatively, we could have an extension / MIME type mapping (mime_guess crate).

lnicola avatar Sep 01 '18 17:09 lnicola

The playground guesses via filename, so I'm in favor. I had trouble trying to implement this in a reusable manner, however (although I don't remember why).

shepmaster avatar Sep 14 '18 21:09 shepmaster

I am also in favor of supporting this 👍

carllerche avatar Sep 17 '18 22:09 carllerche