Solved

File select, folder only

Posted on 2004-08-10
5
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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