Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mget

Class: FTP

Download files from FTP server

Syntax

mget(ftpobj,contents)
mget(ftpobj,contents,target)

Description

mget(ftpobj,contents) retrieves the file or folder specified by contents from an FTP server into the MATLAB® current folder.

mget(ftpobj,contents,target) retrieves the file or folder into the local folder specified by target, which includes an absolute or relative path.

Input Arguments

ftpobj

FTP object created by ftp.

contents

Character vector enclosed in single quotation marks that specifies either a file name or a folder name. Can include a wildcard character (*).

target

Character vector enclosed in single quotation marks that specifies the absolute or relative path of the local folder to contain the downloaded contents.

Examples

Connect to the National Geophysical Data Center (NGDC) FTP server and retrieve the file README.txt into the current MATLAB folder:

ngdc = ftp('ftp.ngdc.noaa.gov');
mget(ngdc,'README.txt');
close(ngdc);

FTP service courtesy of the NGDC. See NGDC Privacy Policy, Disclaimer, and Copyright for NGDC terms of service.

See Also

| |

Introduced before R2006a

Was this topic helpful?