By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

File extensions irrelevant on the web

Why web-developers and designers should avoid file extensions when determining content-type.

Created: 2012-02-25 17:40

File extensions on the web are rarely of relevance, especially when they are located in URLs, and hence some people get confused. URLs on the web is just a address, and has nothing to do with how directories are structured on the server, or what type of file you are downloading. Server admins could easily make all their jpeg images accessible on .png extensions by simply sending the content-type header used for jpeg images.

You can also easily rename a .jpeg image to .png, but it would technically still be a jpeg. So what really determines a file-type is its content, and not its file-extension.

See also

  1. List of Content-types
  2. Absolute and Relative Paths