• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1869
  • Last Modified:

WebClient Download Directory of Files

I can Download file by file some of the files I need to be able to download from my application.  Now I am finding that I need to download an entire directory of files.  The problem is, I will not know what files are in this directory.

How can I do this?

I imagine I need to somehow read the contents of the directory, and loop through all the files, and download each one individually?

p.s.  Cannot use FTP
p.s.s.  VB.Net (2008)
0
kevp75
Asked:
kevp75
  • 9
  • 4
1 Solution
 
kevp75Author Commented:
p.s.s.s.  These files are remote files.

I am building a desktop application to manage my CMS.  I am trying to make it so the user can edit the content of the XML files locally, however, I need to download these content XML files in order to do this.   They are accessibly via a URI
0
 
kevp75Author Commented:
it would be great to be able to pass the good 'ol *.* wildcard to do this....
0
 
CodeCruiserCommented:
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kevp75Author Commented:
Not VB.NET, but I can try my hand at converting it.

anything else?
0
 
kevp75Author Commented:
also...  this isn't a web applicaiton, it's a desktop app
0
 
CodeCruiserCommented:
Code behind is same.
0
 
kevp75Author Commented:
roughly.  just the structure looks different

(ps, I'm new at VB.NET)
0
 
selvolCommented:
Mabey I am missing something. Apologies if I am off .


I take it you cant or just enable Dir browsing? Correct
If you can read the contents of a web page in you app.  Then


simply adding the code below in a FIle what has a obfuscated name will allow you to view the content of the DIR.
If you don't use php.  There is a js equal......


Selvol 

<?php
$myDirectory = opendir(".");
while($entryName = readdir($myDirectory)) {
 $dirArray[] = $entryName;
}
closedir($myDirectory);
$indexCount = count($dirArray);
sort($dirArray);
print("<TABLE border=0 cellpadding=5 cellspacing=0 class=whitelinks>");
print("<TR><TH></TH></TR>");
for($index=1; $index < $indexCount; $index++) {
 if (substr("$dirArray[$index]",0,0) != "rar"){ // don't list hidden files
 print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");

 print("</TR>\n");
 }
}
print("</TABLE>\n");
?>

Open in new window

0
 
kevp75Author Commented:
sort of missing it, but I may end up having to go a route like that.  It looks like I can't simply browse a remote server folder structure.
0
 
CodeCruiserCommented:
If using the FTP would not warrant a jail for you, here is a useful FTP library

http://www.codeproject.com/KB/IP/FtpClient.aspx
0
 
kevp75Author Commented:
what I think I am going to have to do is build a web service on the server to browse a directory and list out the files it contains
0
 
CodeCruiserCommented:
If its your own server and you want to go the webservice route, check this

http://www.codeproject.com/KB/webservices/wsfileserver.aspx
0
 
kevp75Author Commented:
I may be able to go that route as well.  Problem is I am unsure I want to open up an FTP account just for this...    though I may.

I will look through that tho
0
 
kevp75Author Commented:
thank you.  I ended up going the FTP route
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 9
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now