I have oracle db, with have column with blob files.
I getting data from table and i need to show data and blob in form.
Blob can be PDFs or images..
My question are how to know what is in blob,are that image , pdf or something third?
Thanx
I have oracle db, with have column with blob files.
I getting data from table and i need to show data and blob in form.
Blob can be PDFs or images..
My question are how to know what is in blob,are that image , pdf or something third?
Thanx
You'd have to store that information somewhere. Normally, if you're designing a table that stores multiple types of binary data, you'd have a blob
column and then a separate varchar2
column that identifies the MIME type of the data. That would be something like application/pdf
for PDF documents, image/png
for PNG image files, etc.
If you haven't store that data when you loaded the BLOB data initially, I suppose you could try writing code to inspect the first few bytes of data from the BLOB
in order to try to detect what sort of file that is. That, however, would require specifying exactly what data types you want to try to inspect and then looking at the spec for each of these file types to find a reasonable signature of that file type. Obviously, that tends to be much more challenging.