Help with showing contents of files in a particular folder on a web page!!!

Hi, I am developing my website.  On one of the pages I list various projects, when a user clicks on one of the projects  
A page is then displayed asking for username and password.  
Have sorted that out using ASP.Net.

When the user then correctly eneters the username and password.  He is taken to the page of that particular project.

How do I get to list all the files of that particular project onto the webpage.  So that they can then choose a particular file to download.
You can assume that all the files are in the designated folders for each project.

Hope someone can help cheers

Any advice would be appreciated or links to tutorials etc.

Thanks
dthomas31ukAsked:
Who is Participating?
 
joeposter649Commented:
You'd have more control if you streamed the files rather than giving a direct link.  This would allow you to do things such as move the files out of the webroot, check permissions, add http headers etc.  
Here's a quick example...

<%@ Import Namespace="System.IO" %>

<%
        'Set the appropriate ContentType.
        Response.ContentType = "application/rtf"
        Response.AddHeader("content-disposition", "attachment; filename=test.rtf;")
        Response.Charset = "UTF-8"

        'Write the file directly to the HTTP output stream.
        Response.WriteFile("C:\test.rtf")
        Response.Flush()
%>
0
 
dthomas31ukAuthor Commented:
Cheers for that joeposter649.  That works a treat, was thinking might be easier to create PDF files of the files in the folder and just enter links on the webpage.....what do you think????

Obviously wont be able to edited anything, but that will not be a problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.