: 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
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?
More posts by @Murray155
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.