Click here to Skip to main content
15,914,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

how i can download a directory where htaccess enable directory listing?

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 29-Nov-13 13:32pm    

1 solution

You can do it in two steps. In first step, you get the directory listing. Then you parse the text, to extract file names and download each file separately. You need only one class for downloading:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^]
or even, simpler, you can use the method http://msdn.microsoft.com/en-us/library/ms144194%28v=vs.110%29.aspx[^].

Suppose you expect a directory listing at the URL "http://www.someDomain.tld/some/directory/". Downloading with this URL will give you the listing, and the you figure out file name and download them one by one as "http://www.someDomain.tld/some/directory/file1", "http://www.someDomain.tld/some/directory/file2", etc.

Please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA
 
Share this answer
 
Comments
RaisKazi 29-Nov-13 22:31pm    
My 5!
Sergey Alexandrovich Kryukov 29-Nov-13 22:49pm    
Thank you, Rais.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900