You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guard let url =URL(string:"ftps://X.X.X.X")else{return}// I have to use an IP address instead of a domainvarprovider=FTPFileProvider(baseURL: url, mode:.default, credential: credential, cache:.none)
provider.delegate =self
provider.fileOperationDelegate =self// This delegate is only for print the first line of the error before returning true
provider.serverTrustPolicy =.disableEvaluation
With that provider I successfully login into the FTP server and perform some search. For example:
provider.searchFiles(path: remotePath, recursive: false, query: predicate, foundItemHandler:{(file)inprint("File found with name: \(file.name)")}, completionHandler:{(list, error)in
if error !=nil{DispatchQueue.main.async{onError(error!)}}else{varfiles:[String]=[]
for f in list {(f.isRegularFile) ? files.append(f.name):nil}DispatchQueue.main.async{onSucess(files)}}})
That file search show the following warning in console:
When trying to download one of the files is when I get the error. For download I'm using the following:
provider.copyItem(path:"\(remotePath)/\(file)", to: localPath.absoluteString, overwrite: true){(error)in
if error !=nil{DispatchQueue.main.async{onError(error!)}}else{DispatchQueue.main.async{onSuccess(localPath)}}}
This is a weird bug, but it seems to be caused by the nesting of "getting file attributes", then "getting file data" during the download. I remedied up by making a separate call to "attributesOfItem", and then a separate call to "contents" with the resulting attributes. I think it comes down to some re-use of sockets that ends up confusing the SSL properties of the socket.
I'm trying to download a file from a remote FTPS server but I get the following error:
The
provider
looks like:With that
provider
I successfully login into the FTP server and perform some search. For example:That file search show the following warning in console:
But I get a successful output where
onSuccess(files)
returns:When trying to download one of the files is when I get the error. For download I'm using the following:
My
Info.plist
looks like:Some facts:
Why login, listing or searching files works but I get that error when trying to download?
Hope you can give it a look.
The text was updated successfully, but these errors were encountered: