This article shows how to fetch the document files, like PDF, Word and Excel documents, from a database.
Introduction
This article shows how to fetch the document files, like PDF, Word and Excel documents, from a database.For an explanation of that in this article, I will use the following procedure:
The following are the details of the preceding procedure.
Step 1
1. Create a table named "Documents" that will store:
Note
To understand how to save the document files in the database, read my previous article "How to Save PDF, Word and Excel Files Into The DataBase".
Step 2
Get the file from the database via a handler as in the following:1. Delete or comment the 2 default generated lines, that are mentioned below. just because of irrelevancy.
Run the page that will be like:
Click on the file that you want to download.
Result
Now you have all 3 files stored in the database in binary format.
Hands on with ASP.Net MVC - Covering MVC 6