Jump to content

header('Content-Type: image/jpeg'); not behaving as I hoped it would.


Recommended Posts

When I run a script that contains the following code:

 

header('Content-Type: image/jpeg');
readfile("$IMAGES_FILE_PATH/oldman.jpg");

 

I think that my browser should be showing the image that's being referenced (whose contents are, in fact, being read correctly), but instead, it displays the URL of the script that was just run (http://127.0.0.1:8000/Jiggzy%20Quick-Start%20Package/scripts/smartimageresizercustom.php).

 

I'm currently using MAMP (Version 1.7.2 - default installation) and running Leopard (10.5.7) on a MacBook. My PHP information can be found at http://www.jiggzy.com/phpinfo/.

 

Could anyone shed some light on the issue of why DreamHost is displaying the image properly, but not my local version of PHP? Thanks in advance for any help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.