How to retrieve files from ftp website

9 views (last 30 days)
Tiger
Tiger on 2 May 2020
Commented: Walter Roberson on 3 May 2020
Hi, I need to retreive .nc files in a loop from a web address that starts with ftp://
I tried mget, urlread, and webread and none seemed to work for me
Any assistance would be appreciated!

Answers (2)

Walter Roberson
Walter Roberson on 2 May 2020
You create a connection, and then you use cd() and mget() and so on on the object.
  4 Comments
Tiger
Tiger on 2 May 2020
Yup works in web browser, no password
Walter Roberson
Walter Roberson on 3 May 2020
obj = ftp('usgodae.org');
cd(obj, '/pub/outgoing/argo/dac/aoml/13857/');
mget(obj, '13857_tech.nc')
close(obj)

Sign in to comment.


Ameer Hamza
Ameer Hamza on 2 May 2020
  3 Comments
Ameer Hamza
Ameer Hamza on 2 May 2020
Can you show your code with mget().
Image Analyst
Image Analyst on 2 May 2020
outfilename = websave('13857_tech.nc', 'https://usgodae.org/pub/outgoing/argo/dac/aoml/13857/')
only brings down the HTML document, not the actual file.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!