Re: Can I get the Mime Content Type from a byte array?
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
On Fri, 11 Sep 2009 09:07:12 -0700, shapper <mdmoura@xxxxxxxxx> wrote:
I am saving an image, either jpg or gif, to a byte and into a database.
When I get the byte array is there a way to determine the content type
from it?
Or do I need to save in database the content type?
The MIME type isn't inherent in the byte stream. You need to save that
meta-data yourself if you want to be able to recover it reliably.
Of course, an alternative is to write some code that tries all the
different MIME types you expect to be able to handle, and see which one
works. Just depends on what you're trying to do which approach is best.
.
Relevant Pages
- Re: KirbyBase
... creating objects from the database records was much easier. ... Hal, I don't know if you have had a chance to take a look at the beta yet, but I basically tried to implement a uniform way to specify one-to-one links, one-to-many links, and calculated fields in the ... I suppose it would in effect be embedding an array where all the ... My first couple of attempts at adding more complexity to KirbyBase did not honor this concept. ... (comp.lang.ruby) - Re: KirbyBase
... I'm an Object Guy and Jamey is a Database Guy. ... That requires the table name and key field name to be specified ... I suppose it would in effect be embedding an array where all the ... that is) might compress by a factor of 10 or more. ... (comp.lang.ruby) - Re: Dereferencing problem
... I want to work with data from my database. ... dereferencing for display is fine: ... There is no need to to copy the anonymous array to a named array. ... But the disadvantage of using this method is that, because hashes are ... (perl.beginners) - Re: using BLOB objects and ...
... while saving the array object to the database which is ok but while ... convert it back to object of 4 dimention boolean array which will be ... will let you store your 4 dimensional boolean array in it. ... You may have to modify my suggestion ... (comp.lang.java.programmer) - Re: using BLOB objects and ...
... - You could use Memo if you converted your boolean array into a text string. ... boolean array when you fetch it from the database. ... You might be able to put the whole array in an OLE Object, ... (comp.lang.java.programmer) |
|