I have a text list of HDF files I need to download from an ftp server.
This is the (example) structure of the list:
ftp://username:password@ftppath/File#1_hh_mm_ss.HDF
ftp://username:password@ftppath/File#2_hh_mm_ss.HDF
ftp://username:password@ftppath/File#3_hh_mm_ss.HDF
...
I tried to download a single file with this basic script:
url = "ftp://username:password@ftppath/File#3_hh_mm_ss.HDF"
download.file(url, destfile = "Test1.HDF")
What I would like to do is to download multiple files at once (i.e., the ones in the list above), and save them automatically, giving at each file the name of the file as it is in the ftp link (i.e., File#1_hh_mm_ss.HDF, File#2_hh_mm_ss.HDF, File#3_hh_mm_ss.HDF
)
Is anyone able to help?
Thanks!