Error accessing box with FTP

조회 수: 8 (최근 30일)
Becky Heath
Becky Heath 2021년 12월 20일
댓글: Dimitrios Poulos 2023년 3월 4일
I'm trying to use the MATLAB ftp functionality to access files on my box account. I usuallly deal with my box files manually via the box web platform or through FileZilla, both without issue. However, I'm now trying to automate this process with Matlab and have seemingly fallen at the first hurdle.
Going by the MATLAB ftp documentation I unsuccessfully tried to set up a ftp object for my box address:
>>ftpobj = ftp("ftp.box.com",myUname, myPassword);
Error using matlab.io.ftp.FTP (line 175)
Connection refused for "ftp://ftp.box.com".
Error in ftp (line 63)
h = matlab.io.ftp.FTP(host, varargin{:});
Error in NotForGithub (line 8)
ftpobj = ftp("ftp.box.com",myUname, myPassword);
After some searching I found that r2021b had an FTP error at some point (link), but trying their example I found that wasn't the problem in my case:
>> ftpobj = ftp("ftp.ngdc.noaa.gov")
FTP with properties:
Host: "ftp.ngdc.noaa.gov"
Username: "anonymous"
Port: 21
ServerLocale: "en_US"
DirParserFcn: @matlab.io.ftp.parseDirListingForUnix
Mode: "binary"
LocalDataConnectionMethod: "passive"
RemoteWorkingDirectory: "/"
I similarly tried to access box without giving my details (in case there was a problem there specifically) and still got the following issue:
>> ftpobj = ftp("ftp.box.com")
Error using matlab.io.ftp.FTP (line 175)
Connection refused for "ftp://ftp.box.com".
Error in ftp (line 63)
h = matlab.io.ftp.FTP(host, varargin{:});
I've also seen people talk about the "SSH/SFTP/SCP for Matlab (v2)" (link), but it was not clear to me at all how I'd apply that to wat I'm trying to do, so if that is the solution and you have any tips on how I can use it - please let me know! Thanks
EDIT: I updated Matlab today (20th December 2021) and the problem persists

채택된 답변

Becky Heath
Becky Heath 2021년 12월 23일
편집: Becky Heath 2021년 12월 23일
This answer comes from a suggestion I got from my stack overflow question asking the same thing (link).
It turns out my box acount required FTPS so normal FTP would not be permitted. Using the following instead worked perfectly!
ftpobj = ftp("ftp.box.com",myUname, myPassword,'TLSMode','strict');
  댓글 수: 1
Dimitrios Poulos
Dimitrios Poulos 2023년 3월 4일
Error using ftp>parseInputs (line 141)
'TLSMode' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by