473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to list the contents of a folder on an ASP page and make the list clickable.

Thank you for your previous help.

I posted regarding listing the names of files held in a folder on the server
and making the

list appear clickable. This has now been accomplished. The files are
listed - The files are clickable -

There would appear to be a problem now in that the files do not open and run
as they otherwise would do on any standard directory browsing page.

When the link is clicked, rather than open the file and play in a media
player what actually happens is a new browser window tries to open
objFl.Name which obviously it cannot.

The Work Around:

I now have the server open a new window that allows directory browsing. This
is just a temporary measure to get a list of files that open in any media
player. I would obviously like it if the code would open a media player
possibly even in a new frame this would allow me to see the files and have
them play in another frame at the same time as browsing.

I have posted this message before and received no reply so I am apologizing
in advance for this; however since I have not had a reply I felt it
necessary to post again to the group.

The code: I have decided to leave the code out of this message. What I will
say is that anyone who has a genuine interest in what I am trying to achieve
here is free to post there interest / or email me in private to
us***********@btconnect.com

If you could help on this I would be much appreciative.

Kind Regards

Malcolm
Oct 11 '05 #1
3 2881
Sadly, you'll have to show the code, but really only the lines that write the
link to the page.

Most likely you are "" (quoting) it incorectly so you are getting the
literal objName instead of the value.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"mallyonline" wrote:
Thank you for your previous help.

I posted regarding listing the names of files held in a folder on the server
and making the

list appear clickable. This has now been accomplished. The files are
listed - The files are clickable -

There would appear to be a problem now in that the files do not open and run
as they otherwise would do on any standard directory browsing page.

When the link is clicked, rather than open the file and play in a media
player what actually happens is a new browser window tries to open
objFl.Name which obviously it cannot.

The Work Around:

I now have the server open a new window that allows directory browsing. This
is just a temporary measure to get a list of files that open in any media
player. I would obviously like it if the code would open a media player
possibly even in a new frame this would allow me to see the files and have
them play in another frame at the same time as browsing.

I have posted this message before and received no reply so I am apologizing
in advance for this; however since I have not had a reply I felt it
necessary to post again to the group.

The code: I have decided to leave the code out of this message. What I will
say is that anyone who has a genuine interest in what I am trying to achieve
here is free to post there interest / or email me in private to
us***********@btconnect.com

If you could help on this I would be much appreciative.

Kind Regards

Malcolm

Oct 11 '05 #2
Thank you for showing your interest.

Keeping in mind that i have made changes to allow for the page to be browsed
by directory from the server.(IIS6)

The Code:
<%
Dim objFSO,objFldr,objFl, sPath
sPath = "Local Drive:\Inetpub\wwwroot\folder contents"
Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
Set objFldr=objFSO.GetFolder(sPath)
For Each objFl in objFldr.Files
'Print the name of all files in the folder

Response.Write "<a href=""mp3/"" target=""_main"">" & objFl.Name & "</a><br
/>"
Next
Set objFldr=Nothing
Set objFSO=Nothing
%>
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:D8**********************************@microsof t.com...
Sadly, you'll have to show the code, but really only the lines that write
the
link to the page.

Most likely you are "" (quoting) it incorectly so you are getting the
literal objName instead of the value.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"mallyonline" wrote:
Thank you for your previous help.

I posted regarding listing the names of files held in a folder on the
server
and making the

list appear clickable. This has now been accomplished. The files are
listed - The files are clickable -

There would appear to be a problem now in that the files do not open and
run
as they otherwise would do on any standard directory browsing page.

When the link is clicked, rather than open the file and play in a media
player what actually happens is a new browser window tries to open
objFl.Name which obviously it cannot.

The Work Around:

I now have the server open a new window that allows directory browsing.
This
is just a temporary measure to get a list of files that open in any media
player. I would obviously like it if the code would open a media player
possibly even in a new frame this would allow me to see the files and
have
them play in another frame at the same time as browsing.

I have posted this message before and received no reply so I am
apologizing
in advance for this; however since I have not had a reply I felt it
necessary to post again to the group.

The code: I have decided to leave the code out of this message. What I
will
say is that anyone who has a genuine interest in what I am trying to
achieve
here is free to post there interest / or email me in private to
us***********@btconnect.com

If you could help on this I would be much appreciative.

Kind Regards

Malcolm

Oct 11 '05 #3
I don't do the double quote thing - too confusing keeping track of them,
but....
Response.Write "<a href='mp3/" & objFl.Name & "' target='_main'>" &
objFl.Name & "</a><br/>"

The filename needs to be part of the href attribute.

Bob Lehmann

"mallyonline" <ma***********@btinternet.com> wrote in message
news:di**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Thank you for showing your interest.

Keeping in mind that i have made changes to allow for the page to be browsed by directory from the server.(IIS6)

The Code:
<%
Dim objFSO,objFldr,objFl, sPath
sPath = "Local Drive:\Inetpub\wwwroot\folder contents"
Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject")
Set objFldr=objFSO.GetFolder(sPath)
For Each objFl in objFldr.Files
'Print the name of all files in the folder

Response.Write "<a href=""mp3/"" target=""_main"">" & objFl.Name & "</a><br />"
Next
Set objFldr=Nothing
Set objFSO=Nothing
%>
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:D8**********************************@microsof t.com...
Sadly, you'll have to show the code, but really only the lines that write the
link to the page.

Most likely you are "" (quoting) it incorectly so you are getting the
literal objName instead of the value.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"mallyonline" wrote:
Thank you for your previous help.

I posted regarding listing the names of files held in a folder on the
server
and making the

list appear clickable. This has now been accomplished. The files are
listed - The files are clickable -

There would appear to be a problem now in that the files do not open and run
as they otherwise would do on any standard directory browsing page.

When the link is clicked, rather than open the file and play in a media
player what actually happens is a new browser window tries to open
objFl.Name which obviously it cannot.

The Work Around:

I now have the server open a new window that allows directory browsing.
This
is just a temporary measure to get a list of files that open in any media player. I would obviously like it if the code would open a media player
possibly even in a new frame this would allow me to see the files and
have
them play in another frame at the same time as browsing.

I have posted this message before and received no reply so I am
apologizing
in advance for this; however since I have not had a reply I felt it
necessary to post again to the group.

The code: I have decided to leave the code out of this message. What I
will
say is that anyone who has a genuine interest in what I am trying to
achieve
here is free to post there interest / or email me in private to
us***********@btconnect.com

If you could help on this I would be much appreciative.

Kind Regards

Malcolm


Oct 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: middletree | last post by:
I'm on an Intranet, and our Intranet server is on the same domain as the users. I have one place where I wanted to create a clickable link which would take the user to the directory for that...
1
by: New User | last post by:
asp.net framework 1.1 and c# I am trying to create thumbnail images dynamically and load them on a web page. When I click on a thumbnail image it opens the large version of it. I use DataList...
1
by: New User | last post by:
asp.net framework 1.1, C# I am trying to create thumbnail images dynamically and load them on a web page. When I click on a thumbnail image it opens the large version of it. I use DataList to...
3
by: Henrik | last post by:
I need to get a list of clickable objects on the desktop and their positions. I have written a small program in C# and by using the Win32 function: WindowFromPoint -function I get a handle to the...
5
by: nospam | last post by:
Hi there, I'm using VBScript to display a list of the ten most recently updated pages on my web site. Right now, the script lists the filenames and the date modified in a given directory. ...
1
by: Jim in Arizona | last post by:
Anyone know a way or a document that shows how to display the contents (word & excel docs, etc) of a folder as links on a web form that link to the document? TIA, Jim
2
by: ats | last post by:
Hope this is the correct group. I am looking to place a set of constantly changing excel files in a directory on my web server. I want to display these as a list of clickable links on a page. Are...
6
by: aanund | last post by:
I don't know if I'm in the right place, or doing this properly, but I hope someone sees it anyway. I am a rookin i PHP, yet I have found this to be an efficient and useful scripting language for many...
0
by: =?Utf-8?B?ZGIgY2hhbGxlbmdlZA==?= | last post by:
I am realy challenged by MSN Live. I was quite happy with my former hotmail. The new forced-upon-me version has caused me nothing but headaches and lots of work. It consumes huge amounts of my time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.