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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.