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?
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 all
Output was:SETTYPE(BINARY)
RAWCOMMAND("CD 'FTOHCS01' ")
RAWCOMMAND("quote site RECFM=U")
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!
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 all
and (on windows ftp.exe)RAWCOMMAND("SITE RECFM=U")
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 ).
liked Script FTP? Try our other product Email Parser