The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Inserting File And Retrieving it From SQL Server in Asp.Net
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Ron KuncePosted Dec 10, 2015, 5:13 PM
I tried your code download as is and it fails to open MS WORD 2010 .DOCX document taking a corrupt file indication on the binary record item read from the database! I need it display .DOCX and Adobe Acrobat XI .PDF documents from the stored binary content!!!
Olivier GingrasPosted Apr 7, 2014, 3:11 PM
Excellent code! Thanks!
ANAND KUMARPosted Jul 19, 2013, 8:48 AM
Create Table TblUploadDownLoad ( FileId Int Primary Key IDENTITY, [FileName]Varchar(200), Extension char(10), FileData VarBinary(max) )
Former memberPosted Oct 8, 2012, 6:34 AM
This is really good. DOTNETPOOLS.COM
jayesh sorathiaPosted Sep 13, 2012, 7:10 AM
Very Good article. To learn more on insert and retrieve file from sql server visit this links . http://jayeshsorathia.blogspot.com/2012/08/net-tips-c-tips-insert-or-save-file-into-sql-server-database-table.html http://jayeshsorathia.blogspot.com/2012/09/beginning-net-c-tips-get-or-retrive-stored-file-from-sql-server-database-table.html
William PiersolPosted Apr 4, 2011, 5:38 PM
Thanks for the great solution. I am having problems when retrieving Office 2007/2010 file. I get the following error when I select the Open option. Excel found unreadable content in “FileName” . Do you want to recover the contents of this workbook? If you select Yes to recover it, it opens fine. But the error message is unacceptable. It works fine for all document types I have found except Office 2007/2010. Has anyone else seen (And hopefully solved.) this issue? Thanks again.