Here is my super simple and dirty hack:
Create a shell script "putpic" on the zoneminder box with the following (change monitor-X to the monitor you wish to upload:
Code: Select all
wget "http://127.0.0.1/cgi-bin/zm/zms?mode=single&monitor=X&scale=100" -O /tmp/tmp.jpg
curl -T /tmp/tmp.jpg <yourwebsite>/webcam/put.php
Code: Select all
<?php
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://input", "r");
/* Open a file for writing */
$fp = fopen("image.jpg", "w");
/* Read the data 1 KB at a time
and write to the file */
while ($data = fread($putdata, 1024))
fwrite($fp, $data);
/* Close the streams */
fclose($fp);
fclose($putdata);
?>
Then link the image to display in your webpage /webcam/image.jpg
This is a very dirty hack, the put.php should not be in the writable directory and authentication should be added, you should even make sure the uploaded file is of a certain size and actually an image file.
Have fun, hope it is useful for someone
Mycal