how can one specify a directory that websave saves files?

7 views (last 30 days)
I want to specify a directory that websave saves files. I checked https://www.mathworks.com/help/matlab/ref/websave.html. https://www.mathworks.com/matlabcentral/answers/581399-how-to-have-the-matlab-web-browser-automatically-save-a-downloaded-file-to-a-specified-directory-wit says to add the directory name to the file name. But I would hope to change the directory outside websave, Please advise.

Accepted Answer

Jan
Jan on 12 Mar 2022
Using full path names is the reliable and efficient solution:
Folder = 'C:\Your\Favorite\Folder';
File = 'AsYouWant.html';
URL = 'https://www.mathworks.com/matlabcentral/answers/1670074';
websave(fullfile(Folder, File), URL)

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!