Mobile app version of vmapp.org
Login or Join
XinRu324

: Can .php be an image extention? I've recently made a new website and I'm using a template. See this image (link): http://mirrorlessspecialist.com.au/wp-content/themes/paperpunch/images/sidebar/rotate.php

@XinRu324

Posted in: #FileFormat #WebsiteDesign

I've recently made a new website and I'm using a template. See this image (link):
mirrorlessspecialist.com.au/wp-content/themes/paperpunch/images/sidebar/rotate.php

The file extention is .php. Can anyone explain this?

NOTE: When an image is posted here, stackexchange creates it's own location to store it. If you're right clicking and saving the pic in the question, you'll get a .jpg. But, right click on the picture here.

Here are screenshots of what happens when I try to save it:

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @XinRu324

1 Comments

Sorted by latest first Latest Oldest Best

 

@Berryessa866

A PHP script on the server (which is what the URL causes to be run) returns a response to the browser which contains the header

Content-Type: image/jpeg


so the browser knows that what is returned is a JPEG image and displays it accordingly.

The browser uses the response headers to determine what to do with content. Client operating systems may behave differently — Windows, for example, has a heavy dependence on the filename extension. But if you attempt to save the image from the browser on a Windows system, you may find it's given a .jpg extension because the browser knows it's a JPEG image.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme