我正在嘗試使用 MATLAB ftp 功能訪問我的 Box 帳戶上的檔案。我通常通過 Box 網路平臺或 FileZilla 手動處理我的 box 檔案,兩者都沒有問題。然而,我現在正試圖用 Matlab 自動化這個程序,并且似乎在第一個障礙上失敗了。
通過 MATLAB ftp 檔案(鏈接),我嘗試為我的 Box 地址設定 ftp 物件失敗:(注意,我在該檔案中的示例中沒有問題)
>>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);
經過一番搜索后,我發現 r2021b 在某些時候(鏈接)出現了 FTP 錯誤,但是嘗試他們的示例后,我發現這不是我的問題:
>> 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: "/"
無論如何我更新了Matlab,問題仍然存在。受上述啟發,我嘗試在不提供詳細資訊的情況下訪問 Box(以防出現問題),但仍然遇到以下問題:
>> 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{:});
我還看到人們談論“用于 Matlab (v2) 的 SSH/SFTP/SCP”(鏈接),但我完全不清楚我將如何將其應用于我正在嘗試做的事情,所以如果這是解決方案,并且您對我如何使用它有任何提示 - 請告訴我!謝謝
(我還在 MATLAB 社區論壇上發布了此內容,并將粘貼我在這里得到的任何答案(鏈接))
編輯:這是我通過 FileZilla 連接時的輸出:
Status: Resolving address of ftp.box.com
Status: Connecting to 107.152.26.220:21...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing...
Status: Directory listing of "/" successful
uj5u.com熱心網友回復:
ftpobj = ftp("ftp.box.com",myUname, myPassword,'TLSMode','strict');
似乎已經修復它:-)。
但是對于其他類似問題,請參閱問題后面的評論。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/393315.html
