I want to upload an image via the FTP protocol using an ESP32 microcontroller, the sim7600 modem and an SD card.
The only alternative I know of is to use the command "AT+CFTPPUT" or "AT+CFTPSPUT" and transmit the file through the serial port (serial2).
The "AT+CFTPPUT" and "AT+CFTPSPUT" commands have the condition to modify the file if it contains the <ETX.> and <Ctrl+Z> bytes. Particularly the byte <Ctrl+Z> ("0x1A") the modem interprets it as a end of the FTP data
The problem I have is that the image file has many <ETX.> and <Ctrl+Z> bytes and the FTP communication is end to the first <Ctrl+Z> byte that it finds.
Currently I have fixed the problem by changing the <ETX.> and <Ctrl+Z> bytes to another set of characters, but it is an informal solution and requires extra processing on the server.
I would be grateful if you could help me and find a better solution. Thanks.