Solved

File select, folder only

Posted on 2004-08-10
5
525 Views
Last Modified: 2010-05-18
Hi,
I want to select a folder through asp, just like the file select box but you have to pick a file with that, I just want to pick a loctaion, ie "C:\" or "\\Server\foldername\"
0
Comment
Question by:wmpc
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 11760758
You cannot use the file select item to select folders. Your only bet would be to write a script the lists all the folders in a given directory, and have links for each folder that mark that folder as the target ni your DB or script or whatever...
0
 

Author Comment

by:wmpc
ID: 11760841
any pointers to how?
0
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 500 total points
ID: 11761080
To start off you can use this script from w3 to list all subfolders inside a folder

<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")

for each x in fo.SubFolders
  'Print the name of all subfolders in the test folder
  Response.write(x.Name & "<br />")
next

set fo=nothing
set fs=nothing
%>

From here... You need to modify the "  Response.write(x.Name & "<br />")" line to produce a link, that executes a script to select that folder.
ie
Response.write("<a href=""selectfolder.asp?folder=" & server.urlencode("c:\test\" &  x.Name) & """ >" & x.Name  & "</a><br />")

On that script then it takes the folder name and adds it to you DB or whatever you need that folder name for...
None of this is tested. Just pointers in the right direction!!!
Hope it helps
0
 
LVL 6

Expert Comment

by:masirof
ID: 12728049
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: Slimshaneey

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

masirof
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now