Download files from https server using username and password

72 ビュー (過去 30 日間)
sermet OGUTCU
sermet OGUTCU 2021 年 8 月 12 日
コメント済み: Patrik Brigant 2022 年 4 月 1 日
url = '';
In this https server, I need to download "cod09710.eph.Z" file for a specific location in my computer. How I can download this file using username and password related to this https server?


Rik 2021 年 8 月 12 日
You should be able to use websave. You can provide a username and password in weboptions:
ans =
weboptions with properties: CharacterEncoding: 'auto' UserAgent: 'MATLAB (R2021a) Update 4' Timeout: 5 Username: '' Password: '' KeyName: '' KeyValue: '' ContentType: 'auto' ContentReader: [] MediaType: 'auto' RequestMethod: 'auto' ArrayFormat: 'csv' HeaderFields: [] CertificateFilename: 'default'
  8 件のコメント
Patrik Brigant
Patrik Brigant 2022 年 4 月 1 日
@Andre Ferreira Hi, are you using GAMP II aswell or did you solved the issue using Matlab? Thank you :)


その他の回答 (1 件)

Yongjian Feng
Yongjian Feng 2021 年 8 月 12 日
Try this:
username = 'Your username here';
password = 'Your password here';
authStr = [username ':' password];
base64Str = ['Basic '];
headers = {'Authorization': base64Str};
options = weboptions('HeaderFields',headers);
webread('', options)
  6 件のコメント
sermet OGUTCU
sermet OGUTCU 2021 年 8 月 12 日
Dear Yongjian, thank you for your further explanations.


Community Treasure Hunt

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

Start Hunting!

Translated by