Chirag
Chirag

Reputation: 475

File extension from byte[]

i have one data column in db it's contains varbinary(max)

Some of records will be stored in that table

now i want to find out file name and file extention (Mime type) from byte[]

it will be grate help if pass a code

Upvotes: 0

Views: 1995

Answers (1)

Jobo
Jobo

Reputation: 1084

This is not generally possible. If the varbinary-column contains only the file contents there is no way to get the extension. If i would have designed the database there would be another column describing the filetype/extension. If you know there are only images (as an example) in that column stored you could try to find out by looking for "specific bytes" of jpg, png, etc. files.

Upvotes: 1

Related Questions