Reputation: 51
Hi all i'm working on an axis p1343. I tested the ftp upload succesfully.
Now i need to work with http upload to handle images seen that i do not need to keep ol images. So i'm writing a php script to hande the image buffer from that web cam.
After some work i realized that the cam was not sending anything. So i created e really basic script to just test the jpg stream.
I receive a request with no data inside.
Does anyone know how that camera send the stream in the HU (Httpp Upload) mode ?
Thanks.
Upvotes: 2
Views: 1757
Reputation: 11
<?php
file_put_contents('image.jpg', file_get_contents('php://input'));
?>
Upvotes: 1
Reputation: 51
SOLVED!
Solution to download data sent from the cam just use file_get_contents("php://input") so u can access the data stream a retrieve the data that cam sends as an attachment to the request.
This happens because the axis webcam use to send file as an attachment to the request simulating a "download link" request in a browser.
So to catch up those damn bits u have to read the php://input stream .... It took some time time to figure out this workaround ... hope this will help you.
Upvotes: 2