Changing directory on the remote FTP site

Advertisement

dbWizard
Joined:
Posts:
10

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:
If ftpRemoteDir <> "" Then
    Script = Script & "# Change the remote directory" & vbCrLf
    Script = Script & "cd " & Quotes(ftpRemoteDir) & vbCrLf
End If
Where the Quotes() function simply wraps the value stored in the variable in double quotes.

And the value of ftpRemoteDir is simply set like:
ftpRemoteDir = "FolderName"
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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
32,052
Location:
Prague, Czechia

Re: Changing directory on the remote FTP site

No slashes are needed in cd command in the FolderName is a subfolder of the home/root folder.

We cannot help you further unless you show us a complete code.

Or start by creating a simple fixed script file and test that, without any VBA. Would it work then? If it does not, show us that script and its session log file.

Reply with quote

Advertisement

You can post new topics in this forum