you might want to store MIME types along with the binary objects.
In reply to Re: Writing binary data directly to webpage by dmitri in thread Writing binary data directly to webpage by ttcuberat