urlwrite - Save contents of URL to file

Syntax

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

Description

urlwrite('url','filename') reads the contents of the specified URL, saving the contents to filename. If you do not specify the path for filename, the file is saved in the MATLAB current directory.

f = urlwrite('url','filename') reads the contents of the specified URL, saving the contents to filename and assigning filename to f.

f = urlwrite('url','method','params') saves the contents of the specified URL to filename, passing information to the server as part of the request where method can be get or post, and params is a cell array of parameter name/parameter value pairs.

[f,status] = urlwrite(...) catches any errors and returns the error code.

Examples

Download the files submitted to the MATLAB Central File Exchange, saving the results to samples.html in the MATLAB current directory.

urlstring = sprintf('%s%s', ...
'http://www.mathworks.com/matlabcentral/', ...
'fileexchange/Category.jsp?type=category&id=1');

urlwrite(urlstring, 'samples.html');

View the file in the Help browser.

open('samples.html')

See Also

urlread

  


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