websave() adds '.html' to file even though the file extension is specified.
22 ビュー (過去 30 日間)
古いコメントを表示
This question has been asked before https://www.mathworks.com/matlabcentral/answers/525706-websave-adds-html-to-file-name . However, this person's error was not adding the file extension to the name of the file to be downloaded. I am doing that in this case. The website is 'https://cddis.nasa.gov/archive/gnss/data/hourly/2023/008/19/AMC400USA_R_20230081900_01H_GN.rnx.gz' and the filename is 'AMC400USA_R_20230081900_01H_GN.rnx.gz'. When I call websave() it adds the HTML extension.
url='https://cddis.nasa.gov/archive/gnss/data/hourly/2023/008/19/AMC400USA_R_20230081900_01H_GN.rnx.gz'
fname = 'AMC400USA_R_20230081900_01H_GN.rnx.gz'
websave(fname,url)
The downloaded file is 'AMC400USA_R_20230081900_01H_GN.rnx.gz.html'. I have tried gunzip(url) because the file is GNU compressed but the downloaded file is just an HTML doc without the .gz extension.
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 1 月 9 日
It is the login page. You need to create weboptions with your username and password and pass those to websave() after the url. (There might be additional steps as well; I do not have an account there to test it myself.)
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!