How to UPLOAD folder and subfolders to ftp?


how do we use ftp upload in UiPath??

Have you tried using the existing activities @indrajit.shah?


Yes i am trying that only, but i just didn’t find where to configure my ftp details like credentials and host name and etc??

Use FTP session to give the credentials, i.e., authentication and within that, use Upload files @indrajit.shah

Getting this below error -

Where as i have created a folder with sub-folders and files in it

below is my configuration

@Palaniyappan , @loginerror , @Lahiru.Fernando can you guys look this one?? help me get it resolved.

1 Like

Fine you were almost done
kindly check whether you have file writting permission to that folder you have mentioned in REMOTE PATH property
if possible can i have a view on the property panel of upload activity

Cheers @indrajit.shah

thanks for you reply @Palaniyappan
Yes, manually i have full permission over remote path

When i run the flow now not getting any error but, its not even upload the file.

here is the snap of upload property panel

Below is the screenshot of the flow, i change a little -

1 Like

Fine next to Directory exists use a write line activity and mention as dirExists.ToString
i think it goes for ELSE part without uploading and thats why we are not getting any error
Cheers @indrajit.shah

I debugged it and its going to true case.

One more thing need to ask i.e the local path i had mentioned as
here output folder is containing the folder i need to upload so is the path OK or do i have to give the folder path like

now this is the error i am getting :-

RemoteException wrapping System.AggregateException: One or more errors occurred. —> RemoteException wrapping Renci.SshNet.Common.SftpPathNotFoundException: No such file
at Renci.SshNet.Sftp.SftpSession.RequestMkDir(String path)
at Renci.SshNet.SftpClient.CreateDirectory(String path)
at UiPath.FTP.SftpSession.d__30.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.UploadFiles.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)

so are we trying to move file or folder
Cheers @indrajit.shah

i have folder, like below screen shot, the root folder is indrajit.7643_TEST and each folders under the root have file/s,


BTW in upload property i have checked “include subfolders”

Below is the screenshot taken from FTP client -

@indrajit.shah - Can you share the full assigned values for your Local path and Remote path, please?

@sagacity, please refer the previous reply, i had posted, i had pasted the image.

@indrajit.shah That doesn’t show the actual string text you are assigning to your variables that are used in the ftp activity. I’m curious to see how you are assigning these - what values - as the Upload Files activity can be quirky in this regard.

1 Like

@sagacity, I have attached the flow and i had changed the sftp creds. for privacy concern.

Please check.

Main.xaml (7.6 KB)

@indrajit.shah I can’t find anything wrong with the code. I think that is set up properly. The error you pasted leaves me to blieve there is an issue created a new directory. Does the account have access to not only create files (which I think you said it does) but also create directories/subdirectories?

the account have all administrative permissions,


now my main job is to upload the root folder which is containing sub-folders and sub-folders containing files and sub-folders( its more like a directory), to the SFTP .

Now I am not getting any error but even nothing is being uploaded.

@Palaniyappan, @loginerror @sagacity @Lahiru.Fernando
Can you help, how do i zip a folder ?? by folder i mean i creating a folder and sub-folders in it, in run-time and how do i zip it??