Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

urlwrite - Download content at URL and save to file

Syntax

urlwrite(URL, filename)
urlwrite(URL, filename, method, params)
f = urlwrite(...)
[f, status] = urlwrite(...)

Description

urlwrite(URL, filename) reads Web content at the specified URL and saves it to filename. If you do not specify the path for filename, urlwrite saves the file in the MATLAB current folder.

urlwrite(URL, filename, method, params) uses a method of 'get' or 'post', and passes information in params to the server. params is a cell array of parameter name/value pairs.

f = urlwrite(...) assigns filename to f.

[f, status] = urlwrite(...) returns a status of 1 when the operation is successful. Otherwise, status is 0.

Examples

Download the page on the MATLAB Central File Exchange that lists submissions related to urlwrite, found at http://www.mathworks.com/matlabcentral/fileexchange/?term=urlwrite. Save the results to samples.html in the current directory.

urlwrite(...
    'http://www.mathworks.com/matlabcentral/fileexchange',...
    'samples.html', ...
    'get', ...
    {'term','urlwrite'});

View the file in the Help browser:

open('samples.html')

Alternatives

urlread and urlwrite can download content from FTP sites. Alternatively, use the ftp function to connect to an FTP server and the mget function to download a file.

See Also

ftp | urlread | web

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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