can you list files in a local directory with asp?

Posted on 2008-10-01
Medium Priority
Last Modified: 2012-06-27
i have created an .asp file that lists the files of a directory.  I would like to know if it is possible to list the contents of a local dir like My Documents od Desktop?
Question by:nooch44
LVL 25

Accepted Solution

SStory earned 1500 total points
ID: 22617947
It's possible to list anything that you are willing to give permissions to.  It is not recommended, but it is possible.

You would need to give permissions to the IUSR_machinename account for that directory.

If you were to do it, then creating a virtual directory in IIS to the My Documents folder my be the better way.
LVL 16

Expert Comment

ID: 22618567
LVL 16

Expert Comment

ID: 22618600
gah read too quick ^_^; .. definitely agree with sstory.. it's not recommended.

however if you still want to.. you can use recursion to display from the 'parent' folder down to the child folders and it's files.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

LVL 17

Expert Comment

ID: 22620601
Hi there,

if you are referring to listing "My Documents" folder at the web server, then i agree with SStory. But if you are trying to list the "My Documents" folder on the client machine, then it is not possible without the use of ActiveX com.

LVL 25

Expert Comment

ID: 22624324
NicksonKoh is correct in that I assumed you were wanting to list the My Documents on the server.  On the client the client would have to download a program--probably ActiveX, that would allow access to My Documents.  This is not advisable either.

Author Comment

ID: 22626400
since all advise against it i will not be attempting it...thanks for all the input...

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…

624 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