Mobile app version of vmapp.org
Login or Join
Murray155

: Are filename extensions required on served images? If the image I'm serving has the proper HTTP Content-Type is it also required that I have the image filename extension (JPG/PNG/GIF)? Or can

@Murray155

Posted in: #Browsers #BrowserSupport #CrossBrowser #Images

If the image I'm serving has the proper HTTP Content-Type is it also required that I have the image filename extension (JPG/PNG/GIF)?

Or can I just include the image in the page without?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

If you're providing the correct MIME or content types, then it shouldn't make any difference. I think aesthetically though, it's better to have extensions so that if a user wishes to download an image, their computer won't have any issues opening it, and the user would know off the bat what kind of image it is. (Sometimes you'd get a "image corrupt" error.)

For older browsers, this may pose a problem if they are for some reason unable to understand the content types, or if a piece of software (PHP and cURL, "Mike's Marvelous Image Downloader", etc.) does an HTTP request to it, it may not have the same logic that browsers do.

Conclusion: stick with extensions.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme