Change or view current folder on FTP server
cd( displays the path to the
current folder on the server.
newFolder = cd(___) also returns the path as a
character vector. You can use the input arguments from either of the previous
syntaxes. If you use the first syntax, then
newFolder is the path
after you change the folder.
Connect to an FTP server and navigate to a folder on that server.
First, connect to the National Centers for Environmental Information (NCEI) FTP server.
ftpobj = ftp('ftp.ngdc.noaa.gov')
ftpobj = FTP Object host: ftp.ngdc.noaa.gov user: anonymous dir: / mode: binary
Display the contents of the top-level folder. It contains another folder named
DMSP Solid_Earth google12c4c939d7b90761.html mgg INDEX.txt coastwatch hazards pub README.txt dmsp4alan index.html tmp STP ftp.html international wdc Snow_Ice geomag ionosonde
Change folders to the
pub folder. Then display its contents.
ans = '/pub'
WebCD coast glac_lib krm outgoing results rgon
ftpobj— Connection to FTP server
Connection to an FTP server, specified as an FTP object.
folder— Name of target folder
Name of the target folder on the FTP server, specified as a character vector or string scalar. To specify the folder above the current one, use