08-24-2015 08:01 AM - edited 08-24-2015 08:04 AM
I have a directory with some files in the server and used datasocket to download single file. How to download and make a copy of directory with including files in the local system? Please help me to find a solution.
08-24-2015 08:26 AM - edited 08-24-2015 08:26 AM
Is it a web server or a network file path you're trying to download the files from?
I'm assuming it's a web server...there is no 'list directory' function by default that you can call...you have to hope that either the web server shows a file/directory listing by default (e.g. it's a setting in Apache web serveR) if there is no index page in that folder (which you can parse to get the urls to the individual files) or you might need to write a script which does the directory listing for you. The other option is to use something like FTP for your file transfer which has a built in directory listing.
08-24-2015 08:56 AM
It is a webserver as you assumed..The web server also has a directory structure.I can access the directory using a web browser by entering http://ip_address/content/directrory_name format url. And I hope it is clear for you. It would be very helpful if you can detail me the procedure as I'm a newbie.
08-24-2015 10:37 AM
The first thing to do is to get the directory listing using a HTTP client request (I think a datasocket read might also work). This will give you a html page/text which is the 'source' of the directory listing. You will need to parse the text to find the links or file names (use either an xml-type parser or roll your own) and this will give you an array of URLs to download.