> Are you saying you are saving the image in a file? This is unnecessary.
> The
> The image is saved in a database. Imagine a gallery of photos like on
> facebook. The application extracts the image from the database, writes it
> into a file and then generates IMG tags to point to the download files.
>
> It has to work this way - the generated pages are static, only updated
> periodically.
Still the standard solution looks better to me. There is absolutely no
advantages in using files. You have to take care of deleting them, of file
naming, of scalability.
> So an IMG tag has to be used - the question is how to, with an IMG tag,
> does the browser work out what type of file it is? Does it a) look and the
> extension or b) look at the file header.
b)
> And if (b) is that true for all browsers?
To be 100% sure, you need to investigate about every browser separately.
For Mozilla this source
http://developer.mozilla.org/en/docs/How_Mozilla_determines_MIME_Types says:
...for images loaded via <img src>, Mozilla's image library will do content
sniffing (never extension sniffing) to find out the real type of the image.
Look also in this: HTTP content-type and browser support
http://www.byteflex.co.uk/http_content_type_and_browser_support.html

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Cheers, Rob.