mget - Download file from FTP server

Syntax

mget(f,'filename')
mget(f,'dirname')
mget(...,'target')

Description

mget(f,'filename') retrieves filename from the FTP server f into the MATLAB® current directory, where f was created using ftp.

mget(f,'dirname') retrieves the directory dirname and its contents from the FTP server f into the MATLAB current directory, where f was created using ftp. You can use a wildcard (*) in dirname.

mget(...,'target') retrieves the specified items from the FTP server f, where f was created using ftp, into the local directory specified by target, where target is an absolute path name.

Examples

Connect to an FTP server, change to the documents/rfc directory, and retrieve the file rfc0959.txt into the current MATLAB directory.

ftpobj = ftp('nic.merit.edu');
cd(ftpobj, 'documents/rfc');

mget(ftpobj, 'rfc0959.txt')
ans = 
    'C:\work\rfc0959.txt'

See Also

cd (ftp), ftp, mput

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS