top | item 44376171

(no title)

georgyo | 8 months ago

File extensions are just a hint about what the file might be and have nothing to do with what the file actually is. If the server sets the MIME type, the browser will use that as the hint.

But even beyond that, most file formats have a bit of a header at the start of the file that declares the actual format of the file. Browsers already can understand that and use the correct render for a file without an extension.

discuss

order

allendoerfer|8 months ago

What if the user wants to use the file outside the browser, where they do not have access to the HTTP headers?

georgyo|8 months ago

The same is true, if you rename a .png to .jpg and opening it with an image viewer, it will render.