Send image buffer to web via GPRS using HTTP not working...

Hi, I have a project that requires sending an image file to a web folder via GSM.

The segment of code that should do the job is as below:

  if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
    pDBGln("Modem connect fail");
  }else{  
    if (!client.connect(serverURL.c_str(), tcpPort)) {
      pDBGln("Client connect fail");
    }else {
      pDBG("Transfer Starting...");
      client.print(headerTxt+bodyTxt+bodyPic);
      client.write((uint8_t*)tempImageBuffer,ImgMetaData.imSize);
      client.print("\r\n"+bodyEnd);
      pDBGln("Done.");
    }

The code runs but the image is not transferred.
client.write returns no error but does nothing.

But if I do the same via WiFi it works OK with the following code:

  if (!webClient.connect(serverURL.c_str(),tcpPort)){
    return("connection failed"); 
  }
  webClient.print(headerTxt+bodyTxt+bodyPic);
  webClient.write((uint8_t*)tempImageBuffer,ImgMetaData.imSize);
  webClient.print("\r\n"+bodyEnd);
  pDBGln("Done.");

The GPRS connection is OK As in the same project an SQL database is also updated vis GSM.
The location where this project is supposed to run has no WiFi.

Assistance welcome
Thanks in advance.
Paulo

how quickly do you close the client connexion after the command?

Don't post snippets (Snippets R Us!)