I have a set of pdf files stored in the location accessible only by the application - so those files cannot be accessed directly via http.
The file paths are stored by the database and when the user is given the option to download a file the code as below is being executed:
Response.ContentType = "Application/pdf"
Response.AppendHeader("Content-Disposition", "attachment; filename=<some file name>")
Response.TransmitFile(Server.MapPath("<the file path>"))
Response.End()
It all works fine provided I am dealing with a single file
The problem:
I have a stored procedure that returns a list of all the files available to the user for download, and it can return any number of files ranging from 1 to 20.
I would like to create a page that would list all those files along with the download option next to each file.
Something like
File name 1, some description 1, download (button, link?)
File name 2, some description 2, download (button, link?)
It cannot be simply an url link because as I mentioned the files are not directly accessible and some code needs to be executed for each download
What would an elegant solution to accomplish this using .net2.0?