How is UiPath.FTP.Activities.Download Files used?

Hello everyone, I am new to automation with UiPath … please I need help with this activity

I managed to connect to the remote repository with WithFtpSession.
I used DirectoryExists to check the remote directory and it found it, but when I try to download the file to my local repository, it shows the following message.

RemoteException wrapping System.AggregateException: One or more errors occurred. —> RemoteException wrapping FluentFTP.FtpCommandException: No data sets found.

Server stack trace:
at FluentFTP.FtpClient.OpenPassiveDataStream(FtpDataConnectionType type, String command, Int64 restart)
at FluentFTP.FtpClient.OpenDataStream(String command, Int64 restart)
at FluentFTP.FtpClient.GetListing(String path, FtpListOption options)
at FluentFTP.FtpClient.GetObjectInfo(String path, Boolean dateModified)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at FluentFTP.FtpClient.AsyncGetObjectInfo.EndInvoke(IAsyncResult result)
at FluentFTP.FtpClient.b__343_1(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at FluentFTP.FtpClient.d__343.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.FTP.FtpSession.d__25.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.FTP.Activities.DownloadFiles.d__20.MoveNext()
— End of inner exception stack trace —
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.ContinuableAsyncCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

This is my DownloadFiles:

What can I do to solve this problem?

Hi @Zais,
It looks to me like a possible connection issue to the FTP. Are you able to check that with the newest FTP activities package?

Hi Pawel, I think that if your hypothesis was true, then the error message would be “RemoteException wrapping FluentFTP.FtpCommandException: PASS command failed”

I too am having trouble getting FTP to work with mainframe. No one seems to be able to provide valid help.

I know that this is not a perfect solution but if the newest FTP package can’t help you may try to invoke a powershell script. Of course, it depends on what you need to do with this FTP connection.

Hi @Pablito,

Thank you very much for the suggestion to use powershell.
I managed to do the invocation from UIPath but when I download the file it brings me everything encrypted.
Investigate the reason why the content is displayed that way but you cannot come to a conclusion.
Do you have a notion of why this happens?

Are you sure that files that are on the FTP server are not encrypted already there?

Yes, when I do the manual download with FileZilla there is no problem

I consulted this with one of our PMs. The thing is that every FTP server might be different and it is hard to tell what is exactly with this one if we don’t have the opportunity to try it. If this is something that you could share with us (privately) we could take a look at it. Otherwise, the suggestion is to try different security settings tryout - like enabling SFTP, changing SSL etc.