필터 지우기
필터 지우기

How do I stop webread from converting "%2B" into "+"?

조회 수: 4 (최근 30일)
Nathan Lively
Nathan Lively 2021년 10월 10일
댓글: Nathan Lively 2021년 10월 25일
Unforunately, every time it webread runs it converts the all of the "%2B" into "+" and then returns an error. How do I get it to use the exact URL as entered???
It keeps returning this error:
Error using matlab.internal.webservices.HTTPConnector/copyContentToFile (line 389)
The server returned the status 403 with message "Forbidden" in response to the request to URL
https://s3.amazonaws.com/appforest_uf/f1620499445726x864228122125595900/JBL%20VRX932LAP%20PSHF+3dB%20-%202m%20-%207150%20142.csv.
Error in readContentFromWebService (line 62)
copyContentToFile(connection, filename);
Error in webread (line 125)
[varargout{1:nargout}] = readContentFromWebService(connection, options);
Here's my code:
TF = webread('https://s3.amazonaws.com/appforest_uf/f1620499445726x864228122125595900/JBL%20VRX932LAP%20PSHF%2B3dB%20-%202m%20-%207150%20142.csv')
  댓글 수: 7
Rik
Rik 2021년 10월 25일
There isn't any command that I'm aware of. The idea is to replace every character with a value above 255 (or with a special meaning) by its hexadecimal version. So '+' becomes '%2B'. Since webread parses your URL for these changes, you can double-encode them: use '%252B' instead.
The idea is that webread parses the '%25' to a percent symbol and leaves the rest as is.
I have not tested this idea.
Nathan Lively
Nathan Lively 2021년 10월 25일
Thanks Rik. I tried this. Unfortunately, it produces the same error.
oldURL = 'https://s3.amazonaws.com/appforest_uf/f1620499445726x864228122125595900/JBL%20VRX932LAP%20PSHF%2B3dB%20-%202m%20-%207150%20142.csv';
newURL = strrep(url,'%2B','%252B');
TF = webread(newURL);

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

답변 (0개)

카테고리

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

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by