Sending saved picture via GSM to telegram

Hello! I want to build a project that uses ESP-32 cam. When a senzor ( PIR/ Ultrasenzor) detects motion the ESP-32 Cam will take a picture and sends it to telegram. (or saved picture to sdcard it's accessed and sent to telegram).
I can't figure out how to do the part with sending the picture via GSM module.

the GSM modem or the ESP32 itself could

  1. use FTP or MQTT to upload a photo
  2. the ESP32 runs a webserver - a remote web client could connect and see the photo

I would like to connect to gsm module cause it's a remote place.

what have you got at the remote receiver - a laptop with another GSM modem?
which end is in control? e.g. does the remote system connect every now and then to collect a picture or does the ESP-CAM do an upload?
one problem is remote access to modems - unless you have a static IP they tend to be behind NAT boxes

It would be a telephone, the esp-cam could do both, it does not really matter as soon as i get the picture, for example telegram or blynk, so i would like to change the wifi connection to gsm one, but i don't know how to do it in the program. The esp cam would send via telegram a picture when motion is detected, i have the program but only with WI-Fi i would like to transpose that to GSM connection.

Buy a GSM module and learn how to use it. There are plenty of tutorials on line for Arduino.

I know but i was asking for a specific programming as help. I don t get how should i get the sim to send the picture.

You seem to be getting ahead of yourself!

Come back to the forum when you actually have the GSM module and have learned how to transmit some data (it does not matter what data). Follow one of the many online tutorials.

I do actually have a GSM module, and ESP-32 cam and i have set it to take and send pic but only via wi-fi.

Great! The next step is to follow one of the on line tutorials, and learn how to use the GSM module to send some data.

I decided to give up that ideea cause i can't manage it because the lack of pins on the ESP-32 cam. However i still I would like to take a picture when motion detected, but when i connect the PIR sensor to the esp cam it says that card mount failed. code :
Kamera.ino (6,0 kB)

They have a common ground ( PIR and ESP-CAM), but it won't work. The Esp- cam without the pir sensor is working normally. Esp cam is powered through 5V and PIR sensor from a separate battery 9V.