By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,366 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,366 IT Pros & Developers. It's quick & easy.

Iterating and downloading a URL that lists files?

P: n/a
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?
Aug 2 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Aug 2, 5:15 am, "Jim Bancroft" <sd...@sfd.comwrote:
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

Aug 2 '07 #2

P: n/a
Hi,

Alexey Smirnov wrote:
On Aug 2, 5:15 am, "Jim Bancroft" <sd...@sfd.comwrote:
>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
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
--
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
Aug 2 '07 #3

P: n/a
Hi,

Alexey Smirnov wrote:
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
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
--
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
Aug 2 '07 #4

P: n/a
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 :-)

Aug 2 '07 #5

P: n/a
Hi,

Alexey Smirnov wrote:
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
--
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
Aug 2 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.