Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Iterating and downloading a URL that lists files?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Bancroft - 02 Aug 2007 04:15 GMT
Is there a way to open a URL, one that shows nothing other than a directory
listing, and iteratively go through the list to download the files?
Alexey Smirnov - 02 Aug 2007 08:08 GMT
> Is there a way to open a URL, one that shows nothing other than a directory
> listing, and iteratively go through the list to download the files?

Hi Jim,

you can use a HttpWebRequest with a StreamReader to get the page from
the URL, then the content of the page can be parsed with a regular
expression to get the list of all links and then again use
HttpWebRequest to get the files...

Hope it helps
Laurent Bugnion, MVP - 02 Aug 2007 09:50 GMT
Hi,

>> Is there a way to open a URL, one that shows nothing other than a directory
>> listing, and iteratively go through the list to download the files?
[quoted text clipped - 7 lines]
>
> Hope it helps

I did that a long time ago with a Java applet. I then discovered that
the page format was different in Netscape (back then) and IE. I hope
things are more standard now!

HTH,
Laurent
Signature

Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Alexey Smirnov - 02 Aug 2007 11:04 GMT
On Aug 2, 10:50 am, "Laurent Bugnion, MVP" <galasoft...@bluewin.ch>
wrote:

> the page format was different in Netscape (back then) and IE. I hope
> things are more standard now!

Laurent, do you mean that the default directory listing depends on the
client browser? It depends on a web server and not on a browser. I
have no example for IIS, but here's the one for Apache

Default settings:
http://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html

Example how it looks on the website:
http://cohred.org/cohred/content/

When directory browsing in enabled on a web site and there isn't a
default document available, IIS will display the contents of the
directory as a similar page and it looks the same in IE, and other
browsers
Laurent Bugnion, MVP - 02 Aug 2007 12:22 GMT
Hi,

> On Aug 2, 10:50 am, "Laurent Bugnion, MVP" <galasoft...@bluewin.ch>
> wrote:
[quoted text clipped - 5 lines]
> client browser? It depends on a web server and not on a browser. I
> have no example for IIS, but here's the one for Apache

Back then, the client browser used to add content to the directory
listing page. I tested again right now in Firefox and IE, and apparently
this is not the case anymore, so you're lucky!

I am talking about Netspace 4 and IE4, that was back in... not sure...
97 maybe?

Anyway, good luck with your project!
Laurent
Signature

Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Alexey Smirnov - 02 Aug 2007 18:59 GMT
On Aug 2, 1:22 pm, "Laurent Bugnion, MVP" <galasoft...@bluewin.ch>
wrote:

> I am talking about Netspace 4 and IE4, that was back in... not sure...
> 97 maybe?

Huh? We are talking about ASP.NET :-)
Laurent Bugnion, MVP - 02 Aug 2007 19:12 GMT
Hi,

> On Aug 2, 1:22 pm, "Laurent Bugnion, MVP" <galasoft...@bluewin.ch>
> wrote:
>> I am talking about Netspace 4 and IE4, that was back in... not sure...
>> 97 maybe?
>
> Huh? We are talking about ASP.NET :-)

Yeah I was rambling. Your post awoke old nostalgies, sorry :-) I'll shut
up now. :-)

Laurent
Signature

Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.