473,563 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interesting one : Retrieve a list of files within a web folder

Hi all,

I haven't a clue where to begin here (or more to the point - if it's even
possible).

I need to read the names of all the files inside a folder off my web site.
The catch here is that I don't know the absolute path here
(C:\inetpub\wha tever\whatever\ etc...) as it could be on any drive at my ISP.

Is there a way to retrieve a list of these files by somehow using the
relative path (../Images/photos/*)?

Regards
John.
Nov 18 '05 #1
2 1718
use
server.mappath( "images/photos/")
"John" <a@b.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi all,

I haven't a clue where to begin here (or more to the point - if it's even
possible).

I need to read the names of all the files inside a folder off my web site.
The catch here is that I don't know the absolute path here
(C:\inetpub\wha tever\whatever\ etc...) as it could be on any drive at my
ISP.

Is there a way to retrieve a list of these files by somehow using the
relative path (../Images/photos/*)?

Regards
John.

Nov 18 '05 #2
Hrm, using VB.Net as follows:

Server.MapPath( "../Images/photos") will give you the absolute path.

Hope that helps :)

Also, I believe the relative path may work also...maybe not.

Mythran
"John" <a@b.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi all,

I haven't a clue where to begin here (or more to the point - if it's even
possible).

I need to read the names of all the files inside a folder off my web site.
The catch here is that I don't know the absolute path here
(C:\inetpub\wha tever\whatever\ etc...) as it could be on any drive at my
ISP.

Is there a way to retrieve a list of these files by somehow using the
relative path (../Images/photos/*)?

Regards
John.

Nov 18 '05 #3

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

Similar topics

3
3554
by: kafooey | last post by:
Hi all, I've been digging around on the newsgroups and the web for a possible answer for this problem, but have so far come up with nothing so thought I would ask here... I have the following code doing a file upload... $upload_result =
7
5629
by: MAK | last post by:
Hello everyone, I know how to add images and icons etc to dll file. What I would like to know is there is a way to add those icons on the forms during the run time from the dll or to reference it to the dll during the design time, then when I compile the project and install it, then all the images still inside the dll file. not to be...
2
1925
by: Thomas Miller | last post by:
Hello, I have built a c# class library (I will call it "Assembly1"), and built an installer that installs it. It is working well. I created a new asp.net application, right-clicked on references and selected "add reference". My "Assembly1" is not showing up under the list of components under the .NET tab. I have to click "browse" and manually...
4
1544
by: aaj | last post by:
Hi all I have a group of files that I store independently in a temporary folder on the c: drive. Typical things are ini files, bitmaps, icons etc. All access to the files is hardcoded within my software e.g. private Bitmap myTick = new Bitmap(@"C:\TempManager\tick.gif"); etc.... What I would like to do is have the contents of ...
8
2040
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a project and what all setting will I be required to do So that my original project works. Can I keep WebForm1.aspx in root and code behind file in...
2
1623
by: AAJ | last post by:
Hi all I have a few questions about file locations with VS2005, localhost WidowsXP and remotehost Server2003, and I wonder if anyone can help me get started 1) If I build a web site on my local server i.e. Creat WebSite from the opening menu, I can select my local webserver. Most of the files seem to be within InetPub\wwwroot\website\...
1
5541
by: shank | last post by:
I borrowed the below code from http://www.brainjar.com/asp/dirlist/ and cannot get it to read my folder files. I don't get any errors or any output to screen. I have the below folder permissions set to browse. Without using the below page, I can browse the files. What did I miss? thanks! <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% set fs =...
4
1772
by: sam | last post by:
Hi all, Kindly have a look to the code given below ***************************************************************************** Public Function CountFiles(strDir As String, Optional SubDir As Boolean) As Long With Application.FileSearch .NewSearch .LookIn = strDir
1
2274
Jacotheron
by: Jacotheron | last post by:
Hi all I need a php script that can access a folder on the server to list all the files in the folder. While trying to get a solution, I found this script that can list folders in the wamp index.php-file: <?php $projectsListIgnore = array ('.','..'); $handle=opendir("."); $projectContents = ''; while ($file = readdir($handle)) { if...
0
7664
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7885
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.