JohnS 0 Newbie Poster

Hi!

I'm using a database to store images as raw binary.
I can extract this as a byte[] array.
This works well, but to display the image (e.g. on a webpage) I need to know the MIME type, e.g. 'image/gif'

Is there any way of extracting this from the binary data?
I could store this as a separate field, but this is wasteful if it's already there in the binary.

Any ideas?

TIA,
John

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.