Solved

File select, folder only

Posted on 2004-08-10
5
527 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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