Download files from https server using username and password

조회 수: 23 (최근 30일)
sermet OGUTCU
sermet OGUTCU 2021년 8월 12일
댓글: weiyong yi 2023년 6월 28일
url = 'https://cddis.nasa.gov/archive/gnss/products/0971/';
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
Rik 2021년 8월 12일
You should be able to use websave. You can provide a username and password in weboptions:
weboptions
ans =
weboptions with properties: CharacterEncoding: 'auto' UserAgent: 'MATLAB 9.10.0.1716447 (R2021a) Update 4' Timeout: 5 Username: '' Password: '' KeyName: '' KeyValue: '' ContentType: 'auto' ContentReader: [] MediaType: 'auto' RequestMethod: 'auto' ArrayFormat: 'csv' HeaderFields: [] CertificateFilename: 'default'
  댓글 수: 8
sermet OGUTCU
sermet OGUTCU 2021년 10월 4일
Dear @Andre,
I use GAMP II open source software for downloading from the CDDIS. You can run GAMP II independently or using MATLAB.
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 ' matlab.net.base64encode(authStr)];
headers = {'Authorization': base64Str};
options = weboptions('HeaderFields',headers);
webread('http://ip.jsontest.com', options)
  댓글 수: 7
sermet OGUTCU
sermet OGUTCU 2021년 8월 12일
Dear Yongjian, thank you for your further explanations.
weiyong yi
weiyong yi 2023년 6월 28일
Doesn't work on my PC at all. Do you have any further ideas?
thank you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by