[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2005-05-10
5
Medium Priority
?
148 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:dthomas31uk
  • 2
3 Comments
 
LVL 15

Expert Comment

by:joeposter649
ID: 13971865
0
 

Author Comment

by:dthomas31uk
ID: 13975727
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
 
LVL 15

Accepted Solution

by:
joeposter649 earned 2000 total points
ID: 13978968
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question