
Originally Posted by
Dan Grossman
It's fine for you, but not for all image viewers. If you want it to be fine for everyone, then the file extension should match what's in the file.
I bet you can figure out the real file type looking at just the beginning of the file, then send the right extension and content-type headers. Just look up the specification for the image formats you've stored and figure out what the file contents look like.
Write a little program that examines each BLOB, figures out what file type is in there, and updates a new column to store the type. Then you won't have this problem when it's time to send that file to someone.
Bookmarks