Answer the question
In order to leave comments, you need to log in
How to extract files from binary data to MSSQL DB?
There is a table in the sql server database (2008), which stores files (of various formats, mainly doc and pdf) in a field with a varbinary data type. You need to go through the table and pull out all the files in the folder as the actual files.
To begin with, I experiment with one doc file - I pull out binary data into a variable and try to open the file in the browser.
$file_body ='0xA8A930310C00000052020000789C6D50CD4E834010B....';
header('Content-type: application/doc');
header('Content-Disposition: attachment; filename="doc.doc"');
echo $file_body;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question