AT#FTPOPEN=”IP”,username,password
OK
AT#FTPPUT=<filename>,1
(the new param 1 means that we open the connection in command mode)
OK
Here data socket will stay opened, but interface will be available (command
mode)
AT#FTPAPPEXT=Size
>...
write here the binary data. As soon Size byte are written, data are sent
and OK is returned
#FTPAPPEXT:<SentBytes> OK
……..
Last #FTPAPPEXT will close the data socket, because second (optional)
parameter has this meaning:
AT#FTPAPPEXT=Size,1
>... write here the binary data. As soon Size byte are written, data are sent
and OK is returned
#FTPAPPEXT:<SentBytes> OK
If the user has to reopen the data port to send another (or append to the
same) file, he can restart with the FTPPUT (or FTPAPP).
Then FTPAPPEXT, ...to send the data chunks on the reopened data port.
NOTE: if while sending the chunks the data port is closed from remote, user
will be aware of it because #FTPAPPEXT will indicate ERROR and cause
(available if previously issued the command AT+CMEE=2) will indicate that
socket has been closed.
Also in this case obviously, data port will have to be reopened with FTPPUT
and so on...(same sequence)