0

I'm having an issue with the UploadFiles method of the FluentFTP library. This is my code:

var count = _client.UploadFiles(filesPaths, remotePath, true, true);
foreach(var path in filesPaths)
{
    AddLog(string.Format("Uploaded File: {0}", path));
}

And after execute UploadFiles it throws an exception saying Can't find file. I discovered when I use remotePath = "/uploads" I have this issue, but when I set remotePath to "/", the method uploads files without problems. I checked user permissions and he can do everything.

I don't know what could be the problem. I read the source code in GitHub and I didn't find anything weird.

Is it a bug of FluentFTP? Or am I missing something?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
  • Future readers should see the cross-post on the library's issue tracker, at https://github.com/robinrodricks/FluentFTP/issues/70. The underlying cause was a permissions issue on the FTP server. – Mark Amery Jan 06 '18 at 21:51

1 Answers1

0

If the folder /uploads is not created, you will get that exception.

Option 1: Create the folder uploads manually and try again

Option 2: Use

DirectoryExists() - Check if a directory exists on the server.

CreateDirectory() - Creates a directory on the server. If the parent directories do not exist they are also created.

Community
  • 1
  • 1