Reputation: 3492
I was asked to solve an ASP.NET Question below by my friend.
The question is:
A folder named 'Files' is in the server with a pdf file named Emp_Details.pdf, Once the URl 'www.MyDomailName.com/ShowDetails.pdf
' is browsed. The pdf in server (Emp_Details.pdf) must be downloaded.
It looks strange for me. How the pdf name 'ShowDetails.pdf' will redirect to the physical pdf file 'Emp_Details.pdf'.
Upvotes: 0
Views: 236
Reputation: 471
Instead of storing your files in such a relative file path, you can very well store it in some local/network folder in the server. Upon user request to download, read the file and stream it to the browser using "application/octet-stream" as content type. Hope this helps
Upvotes: 0