FUNCTION REFERENCE

websave

Save content from a web service to a file.

Save content from a web service to a file.

Syntax

outfilename = websave(filename, url)

Syntax

outfilename = websave(filename, url, name1, value1, ...)

Syntax

outfilename = websave(..., options)

Downloads the response body unchanged into filename (relative names are in the current folder) and returns the full path. Query pairs and options are as in webread. The download goes to a temporary file in the same folder that replaces filename only when the request succeeded, so a failed request leaves an existing file untouched.

Example

f = websave('data.csv', 'https://example.org/data.csv')

Differences from MATLAB: Requests run through the system curl program; there is no websave in the browser console. GET only; no authentication options. No extension is added from the content type when filename has none. Downloads are limited to 4 GiB.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.