LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to download directory and containing files using data socket

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.

0 Kudos
Message 1 of 4
(2,932 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 4
(2,909 Views)

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.

0 Kudos
Message 3 of 4
(2,895 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 4
(2,869 Views)