I am trying to upload files to the SFTP server using following code
bool FolderFlag = CreateDirectoryInSFTP(SFTPpath);
if (FolderFlag)
{
if ((System.IO.File.Exists(localFileName)))
{
objsftpRebex.Upload(localFileName, SFTPpath, 0, 0, ActionOnExistingFiles.OverwriteAll);
}
}
Where localFileName will be like
string localFileName = @"D:\Temp1\489892\ModifiedFile\AG-Modified
Department of Housing and Urban Development Notice to Targets.pdf";
And SFTPpath is a big string having more than 250 characters
eg:
SFTPpath=@"/uploads/TargetBridge/Target Setup 3/Target-Outgoing/Modifeid Target
Docs/59976/42afa102-8bee-454c-bc57-6b3b8edb721a/ Target Department of
Housing and Urban Development Notice to Modification/AG-Target of
Housing and Urban Development Notice to Modification/
But this code is not working getting error like No such file; File not found.
When the SFTPpath is smaller in length this code is working absolutely fine. Please tell me what is happening while target SFTP path is too long ? or is there any other ways to handle these kind of long directories,files in SFTP?