Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

File select, folder only

Posted on 2004-08-10
5
Medium Priority
?
533 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 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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 informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 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