WIZnet Developer Forum

Wizfi360 "AT+CIPSEND" for POST request (multipart/form-data)

I need to send a file to Telegram chat wth a bot. It works fine if only to send short files.
What i am doing - I establish SSL connection to server, then make AT+CIPSEND=2048 (max number) and then send multipart/form-data structure . This structure has head, file itself and tail with its place priority . If the size of (head+ file+tail) is no more then 2048 it gets a good answer from the server and i get a message in my Telegram group with the file.
But what If I need to send a longer file then 2048 bytes - how to escape limitation of 2048 bytes?
I tried this construction AT+CIPSEND=2048 > sending…bytes of (head + part1 of file) SEND OK, then another AT+CIPSEND=M bytes > sending… M bytes of (part2 of file + tail) SEND OK.
And then nothing happens, only after some time i get these answers ““504 Gateway Time-out”” for the first sending and " 400 Bad Request" for the second sending. It looks like the server does not take these 2 sendings as a whole message and does not react adequately.

Please let me know what i am doing wrong with CIPSEND command? How to solve this prblem? Thank you.

Hello,

Well, you are not doing anything wrong with CIPSEND, it has a limit of 2048.
I don’t know well about Telegram server, but have you tried transparent mode transmission?

Viktor, thank you for the answer. Sorry but “AT instruction set” says that AT+CIPSEND is a command to start sending data in transparent transmission mode on the page 45. Why you ask me if i tried a transparent mode transmission when i used AT+CIPSEND command. I think it is the only way to transmit in transparent transmission mode . Am I right? Or what did you mean by that? Thank you.

When you set length as parameter to CIPSEND then WIzFi360 sends in normal mode, not transparent.

If you send AT+CIPSEND without any parameter, then WizFi360 will enter transparent transmission mode and will transfer everything unless you send “+++” as single packet.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.