I'm trying to write code to ftp files to and from an ftp site. I'm able to connect to the server and give it the username and password. The cwd command works as it goes into the /htdocs folder. But when I use the SEND, GET or PUT commands, it says they aren't understood. Here is the code. Any suggestions?
Thanks, Dave
FUNCTION PBMAIN()
ftpHost$ = "localhost" 'you would either use the same localhost or substitute it for an ip address
TCP OPEN PORT 21 AT "server location" AS #1 'open the command channel to the ftp server
DO
TCP Line#1, a$
MSGBOX a$ 'get the first splurge of data returned
LOOP UNTIL EOF(1) 'from the ftp server, usually the greeting
TCP PRINT#1, "user ftp-username"
TCP Line#1, a$
MSGBOX a$ '331 Password required for ************
TCP PRINT#1, "pass password"
TCP Line#1, a$
MSGBOX a$ '230 User ******** logged in
TCP PRINT#1, "cwd /htdocs"
TCP Line#1, a$
MSGBOX a$ '250 CWD command successful
TCP PRINT#1, "get aaaa.txt"
TCP Line#1, a$
MSGBOX a$ '500 GET not understood
TCP PRINT#1, "send bbbb.txt"
TCP Line#1, a$
MSGBOX a$ '500 SEND not understood
TCP CLOSE 1
END FUNCTION
Thanks, Dave
FUNCTION PBMAIN()
ftpHost$ = "localhost" 'you would either use the same localhost or substitute it for an ip address
TCP OPEN PORT 21 AT "server location" AS #1 'open the command channel to the ftp server
DO
TCP Line#1, a$
MSGBOX a$ 'get the first splurge of data returned
LOOP UNTIL EOF(1) 'from the ftp server, usually the greeting
TCP PRINT#1, "user ftp-username"
TCP Line#1, a$
MSGBOX a$ '331 Password required for ************
TCP PRINT#1, "pass password"
TCP Line#1, a$
MSGBOX a$ '230 User ******** logged in
TCP PRINT#1, "cwd /htdocs"
TCP Line#1, a$
MSGBOX a$ '250 CWD command successful
TCP PRINT#1, "get aaaa.txt"
TCP Line#1, a$
MSGBOX a$ '500 GET not understood
TCP PRINT#1, "send bbbb.txt"
TCP Line#1, a$
MSGBOX a$ '500 SEND not understood
TCP CLOSE 1
END FUNCTION
Comment