AT#FTPOPEN="IP",username,password
OK
AT#FTPPUT=<filename>,1
OK
the second param (1) means that we open the connection in command mode
Here data socket will stay opened, but interface will be available (command
mode)
AT#FTPAPPEXT=Size
>binary data
#FTPAPPEXT: <sentBytes>
OK
write here the binary data. As soon Size bytes are written, data are sent and
OK is returned
Last #FTPAPPEXT will close the data socket, because second (optional)
parameter has this meaning:
AT#FTPAPPEXT=Size,1
>binary data
#FTPAPPEXT: <sentBytes>
OK
write here the binary data. As soon Size bytes are written, data are sent and
OK is returned and the data socket is closed.
If the user has to reopen the data port to send another (or append to the
same) file, they can restart with #FTPPUT (or #FTPAPP).
Then #FTPAPPEXT to send the data chunks on the reopened data port.
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 the related commands.