Max size limit for HttpResponse* post_res = post_req->send(body, size)

I am using #include "https_request.h" in my code and created request to upload image passing body and size of image.

HttpResponse* post_res = post_req->send(body, imgSize);

 

But My image size is->

char body[640*480];
unsigned long imgSize;

I have uploaded image successfully to dropbox but it is blank. I think it is not uploading full size of data.

Is it because of limit of size in post_req->send(body, size)?

I have gone through (https_request.h) where I found size if passed to nsapi_size_t.

and this typedef unsigned int nsapi_size_t.

  • Hi Brijesh,

    Any updates on this issue? Have you found out the reason why the uploaded image is blank?

    JB
    RenesasRulz Forum Moderator

    https://renesasrulz.com/
    https://academy.renesas.com/
    https://en-us.knowledgebase.renesas.com/

  • Are you uploading image on esp32's normal mode?
    In normal mode you can only upload 2Kb data as single packet. The esp 32 has another mode of operation ie; wifi pass through mode, by ente ring this mode you can upload large files.I have already tested uploading 640x480 images.
    If the mode is the problem please let me know, i can help you.
  • In reply to JB:

    still not, but I have checked the size of the image which is uploaded. It is in Kb, so which gives hint that there is a problem in the upload of full image size.
    Might be one of reason as mentioned by @jihas
    I will try and let you know.

  • In reply to jihas:

    @jihas Could you please tell me how to change the mode of esp32.

    and for sending data even I directly added memory size still no success
    HttpResponse* post_res = post_req->send(body, 19200); //160*120 = 19200

  • In reply to Brijesh:

    Note: No libraries used ,only AT commands

    you can change the mode to wifi passthrough mode by "AT+CIPMODE=1"
    Then connect to your server by
    AT+CIPSTART="TCP","example.com",80
    Once connected to the server it will maintain the connection until you exit the wifipass through mode
    when you entered in to this mode and established a server connection, you won't be able to send any at commands until you exit the mode
    To exit from this mode you need to send the escape sequence ie;three plus symbols (+++) there must be a delay of 1 second before and after the sequence

    If you want to send a POST request then send "AT+CIPSEND" without the size parameter

    then you will recieve ">" symbol from esp

    then send your request


    This is a sample request to send a photo,

    POST /projects/2018/exmple.php? HTTP/1.1\r\nHost: example.com\r\nContent-Length: <size of the data+2>\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ndata=<data>\r\n


    replace this with actual size-> <size of the data+2>