![]() |
Content- type won't change, dynamic image
Hi, I came across an issue while trying to dyamically change the content-type to the right type for an image
Here is show.php Code:
<?phpCode:
CREATE TABLE pics (Any Help would be appreciated, thanks. - The issue is it outputs the data as text/plain , I failed to mention this previously |
Are you storing the full type like 'image/jpeg' or something like 'jpeg'?
php Code:
If the content type is not correct, the browser may default to text/plain. |
Binary data does not equal plain text. You can't store binary data in a varchar field. Use the blob type instead.
|
Quote:
|
Right. Didn't see that. My bad. However, you should try putting an exit; after that echo, and remove the ?> sign from the end. That way, you're making sure that nothing after that point will be sent to the browser. And, you should use the same content type the image had before inserting it into the database. You're probably doing that already, I assume.
|
I'm using image/foo.
It is stored in the database for that particular image so that it always has the right type. I know it's selecting the right content-type also because if I echo out the type instead, i get image/jpeg for a jpeg image and the same with png. It worked on zymic.com's servers, but not 1and1.com's so it puzzles me. |
| All times are GMT. The time now is 04:58 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0