ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Post here if you experience file transfer problems or unexpected errors.
So, I have a script that will connect, and because I'm required to put a single quote before and after the directory name, I've used RAWCOMMAND to do the change directory. I've also used RAWCOMMAND to quote site.

However, the server is responding that the commands are unknown.

When I run them ouside of script FTP I don't have a problem. Could you suggest what could be the issue?
Code: Select allSETTYPE(BINARY) RAWCOMMAND("CD 'FTOHCS01' ") RAWCOMMAND("quote site RECFM=U")
Output was:
SETTYPE(BINARY)
Setting file transfer type to BINARY.

RAWCOMMAND("CD 'FTOHCS01' ")
The server replied: 500 unknown command CD


RAWCOMMAND("quote site RECFM=U")
The server replied: 500 unknown command quote
of note, when I run this using windows built-in ftp client, here's how it looks
ftp> cd 'ftohcs01'
250 "FTOHCS01." is the working directory name prefix.
ftp> bin
200 Representation type is Image
ftp> quote site RECFM=U
200 SITE command was accepted
ftp>
I've solved my own problem here, but wanted to list what I did:

Instead of using RAWCOMMAND to change directory I went with a CHDIR(" 'FTOHCS01' ")

It almost looks like RAWCOMMAND is passing a quote to the command, because when I changed my other command to be RAWCOMMAND("SITE RECFM=U") That took as well.

This makes sense, because it was erroring saying that quote was not regonized, but I think it's passing along "quote quote site"

May want to consider updating the documentation on RAWCOMMAND to this, if my hunch is correct.

Thanks so much!
It almost looks like RAWCOMMAND is passing a quote to the command, because when I changed my other command to be RAWCOMMAND("SITE RECFM=U") That took as well.
Note that windows ftp.exe's "quote" is the equivalent of ScriptFTP's RAWCOMMAND. I mean, the word quote is just the name of the client command as is not actually passed to the FTP server (it does not understand what quote means). For this reason, as you have realized these commands do the same:
Code: Select allRAWCOMMAND("SITE RECFM=U")
and (on windows ftp.exe)

quote SITE RECFM=U


I have updated the RAWCOMMAND help topic to remark this issue. (see http://www.scriptftp.com/reference.php?go=topic163) I think that many users are falling in the same error, thanks a lot for the feedback meatstack (good nickname BTW :D ).