Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i want store docx or rar or png or pdf..... in db sql server

i dont problem with store .i want store in db.

my problem is edit in db

how download file docx or pdf from db
Posted

You can probably make use of binary data type in your database. Store your file data and file name separately in two columns. Have file data as bytes. C# has a way to get bytes from a file:

File.ReadAllBytes[^]

Get the byte array and write it to the file data column. Store the file name in another column.

When you read it back, simply use the following method after getting the bytes into a byte array:

File.WriteAllBytes[^]
 
Share this answer
 
v2
Hi,

I used the following help. That really works for me. I hope this will help you also.

url : http://www.c-sharpcorner.com/UploadFile/0c1bb2/uploading-and-downloading-word-files-from-database-using-as

Just modify the code as per your project requirement... Best of Luck

Avinash
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900