Webpage that displays the contents of user uploaded documents

P

PC360

I have created a form for users to upload documents (pdfs, txt and
docs). These documents are to be accessible (downloadedable or
viewable) to all the other users. The website is set for No Anonymous
Browsing. The docs are shared between a small group of users.

So what I am trying to make happen is that when we each upload a few
files, a web page which is somehow linked to that folder will
display,as links, the contents of the upload folder so we can view or
download any of the documents. I want to avoid having all the
documents sent to me, and then posting them with links. I would like
to have a page that simply links to each file uploaded in the uploads
folder automatically.

These docs will change several times per month. There are only 8 users
sharing documents.

Thanks in advance
 
N

Nicholas Savalas - http://savalas.tv

Dear PC,
Here - just change the path (images/) to your folder, and allow
anonymous upload to that folder. Save as an .asp file. Good luck.

At top of page (before any other code)


<%
Response.Buffer = True
%>


In the body:


<%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim folder
Set folder = fso.GetFolder(Server.MapPath("images/"))

If folder.Size > 0 Then
Response.Write "<ul>"
For Each file In folder.Files
Response.Write "<li type=""circle"">"
Response.Write "<a href=""images/"
Response.Write file.Name & """>"
Response.Write "<b>" & file.Name
Response.Write "</b></a> "
Response.Write "( Size: " & file.Size & " ) "
Next
Response.Write "</ul>"
Else
Response.Write "<ul><li type=""circle"">No Files Uploaded.</ul>"
End If
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top