By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Returning image.... (header format)

P: n/a
Hi

I want to read an image an return it to the user - the point is, that
it can be any graphic image, so I need to set it properly.

AFAIK there are imaga/jpeg, image/png - then? image/gif and image/
svg ?
codesnip:
$ext=ExtractFileExt($somefile);
if($ext=="jpg")
$ext="jpeg";
header("Content-type: image/$ext");
readfile($somefile);

As of now, testing with a gif, it works... changing it to jpeg and it
still works with gif :-)

Comments? Thoughts?
Dec 26 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.