Download AMR file

Hi,
I’m wondering how to send a file by RS232 to the rep /ftp a AMR file. by KFSFILE? But how to know the number byte for
AT+KFSFILE=0,“ftp/son1.amr”,xxx ???

thank.

Hiya,

You’ll have to work that out in the application issuing the AT commands (i.e. your micro on the other end of the RS232 link). You’re going to have to do some level of byte management in the micro anyway when you’re building/recording the AMR file.

Is there any way you could use HTTP POST instead of FTP? If you can, then use ‘chunked-encoding’ which doesn’t need the number of bytes in the file being POST’ed.

ciao, Dave

+KFSFILE=0 is to write file from host into the HL’s flash.

I guess your host application should have the AMR file ready so the file size should be available before you send +KFSFILE, depends on programming language, for example using C, we can get it using fseek()/ftell().

For test purpose or manual operation, we can find the file size for example, using file explorer, or “dir” command on Windows OS and “ls -l” on Linux.

OK thanks,
but when i check the size of AMR file 8025 bytes, i enter AT+KFSFILE=0,"/ftp/son1.amr",8025
after i send the file, but never ack “OK” i need to send CRLF and after i have “OK”
but when i send AT+KPLAYAMR=0,“son1.amr”,10,1
i have a AT+KPLAYAMR_ERROR: 16???