Comments on: ESP32-CAM Post Images to Local or Cloud Server using PHP (Photo Manager) https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 22 Jun 2025 05:53:45 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: bill https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-1059906 Sun, 22 Jun 2025 05:53:45 +0000 https://randomnerdtutorials.com/?p=97893#comment-1059906 I had to modify the line:
$target_file = $target_dir . date(‘Y.m.d_H:i:s_’, $datum) . basename($FILES[“imageFile”][“name”]);
to
$target_file = $target_dir . date(‘YmdHis
‘, $datum) . basename($_FILES[“imageFile”][“name”]);

removing special chars from the file name.

Also, had to go onto host, and change permissions of target directory to allow writing of files.

]]>
By: Mingdong https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-1052575 Sat, 31 May 2025 01:48:46 +0000 https://randomnerdtutorials.com/?p=97893#comment-1052575 In reply to Sara Santos.

Sara,

I tried to use your code to upload a file to a real webserver instead of raspberry pi, however, the Client.write() function is not consistent, sometimes it runs for 1ms to send a 1k data block, sometimes it took 10s but sent nothing, I can not send any file bigger than 10k, very annoying. adding delay(5) after each Client.write() helps success rate, but not 100%, any clue there? is there a way to query ESP internal TX data queue, make sure it is empty before call the next Client.write()?

Thank you for all your great articles, which jump started me on my small project.

]]>
By: Viren https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-953581 Tue, 03 Sep 2024 14:09:30 +0000 https://randomnerdtutorials.com/?p=97893#comment-953581 In reply to Mirtt.

Yes it helped Thanks

]]>
By: Cameron https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-932755 Mon, 01 Jul 2024 06:30:32 +0000 https://randomnerdtutorials.com/?p=97893#comment-932755 In reply to Petri Luoto.

Did you ever get this worked out?
I cannot figure out how to add anything to the form data to go along with the image.
Seems like it would be common and simple, but I am not finding any information RE “client.write” to populate form fields or otherwise get data to the receiver php file.

]]>
By: Minu Rasa https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-922071 Thu, 06 Jun 2024 11:16:18 +0000 https://randomnerdtutorials.com/?p=97893#comment-922071 : )

]]>
By: Minu Rasa https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-921736 Wed, 05 Jun 2024 11:52:17 +0000 https://randomnerdtutorials.com/?p=97893#comment-921736 Hi Sara or anybody else who might be reading this lines,

you might be aware the TimerCam-F is not often specifically referenced in randomnerdtutorials. I try to adapt as far as possible the nice sample provided for the Typ F Cam. But even with simplest
example ‘capture.ino’ accessible at ‘https://github.com/m5stack/TimerCam-arduino/tree/master’
it fails for larger pic size configurations as denoted below. Could you probably give me a hint
how that might be addressed to be solved?

I would like to increase pix size of the picture as denoted below, but up on the size and higher resolution than:
FRAMESIZE_SVGA, // 800×600
the function ‘TimerCAM.Camera.get()’ gives any no response at all.

Remark: I have the latest TimerCam-arduino-master.zip 1.0.0 installed, but
I don’t have much experience with the right memory settings/management (that’s all taken by default in my case).

I expect the size FRAMESIZE_UXGA, // 1600×1200 should also work as max. resolution.

Many thanks for your help and answer in advance!

Minu

]]>
By: zhekch https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-908296 Sun, 21 Apr 2024 16:39:42 +0000 https://randomnerdtutorials.com/?p=97893#comment-908296 In reply to matthew butsko.

Thank you so much, I had the same issue and tried to understand what was happening. This comment helped so much.

]]>
By: torsten https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-897531 Sun, 10 Mar 2024 09:50:55 +0000 https://randomnerdtutorials.com/?p=97893#comment-897531 In reply to Vinicius.

I have the same problem. Has anyone here already found a solution?

]]>
By: mhk form south korea https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-896658 Wed, 06 Mar 2024 11:11:48 +0000 https://randomnerdtutorials.com/?p=97893#comment-896658 In reply to matthew butsko.

You save my life. Thank you a lot.

]]>
By: Dave Fischer https://randomnerdtutorials.com/esp32-cam-post-image-photo-server/#comment-886848 Mon, 29 Jan 2024 15:42:22 +0000 https://randomnerdtutorials.com/?p=97893#comment-886848 In reply to Petri Luoto.

Hello – I was able to add a section to the PHP to insert a tag in the image — here is a code clip (you need to have a font available to the script) —

// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo “Sorry, your file was not uploaded.”;
// if everything is ok, try to upload file
}
else {

$jpg_image = imagecreatefromjpeg($filedata);
// Allocate A Color For The Text
$white = imagecolorallocate($jpg_image, 255, 255, 255);
$blue = imagecolorallocate($jpg_image, 0, 0, 255);

//$font_path = ‘http://your_web_host_url/fonts/DejaVuSans-Bold.ttf’;
$font_path = ‘/fonts/DejaVuSans-Bold.ttf’;

//$img_date = date(“m-d-Y H:i:s”);
$img_date = new DateTime(‘now’, new DateTimeZone(‘America/New_York’));

$imdt2 = $img_date->format(‘Y-m-d H:i:s’);

imagefilledrectangle($jpg_image, 0, 0, 285, 30, $white);
imagettftext($jpg_image, 16, 0, 10, 20, $blue, $font_path, $imdt2);

// imagejpeg($jpg_image); //– output to browser
imagejpeg($jpg_image,$target_file);

//if (move_uploaded_file($_FILES[“photo”][“tmp_name”], $target_file)) {
echo “The file “. basename($_FILES[“photo”][“name”]). ” has been uploaded.”;

// Clear Memory
imagedestroy($jpg_image);
}

]]>