Changing directory on the remote FTP site
I've got some VBA code that is generating and executing an SFTP script file to transfer files from a client of mine to one of their business partners. The SFTP is working properly, except that the change directory command does not seem to be working properly.
My code looks like:
Where the Quotes() function simply wraps the value stored in the variable in double quotes.
And the value of ftpRemoteDir is simply set like:
But when I run the script file, it is loading the files into the root folder on the SFTP site. Do I need to include a forward or backwards slash in order to get the destination folder to change properly from the root folder to the correct folder name?
My code looks like:
If ftpRemoteDir <> "" Then Script = Script & "# Change the remote directory" & vbCrLf Script = Script & "cd " & Quotes(ftpRemoteDir) & vbCrLf End If
And the value of ftpRemoteDir is simply set like:
ftpRemoteDir = "FolderName"