Raspberry Pi camera still capture & HTTP upload

Write a bash script on Raspberry Pi:

raspistill -o vattu.jpg
curl --form "fileupload=@vattu.jpg" http://domain.fi/vattu.php

and PHP at server side to process the upload:


$userfile_name = $_FILES['fileupload']['tmp_name'];

if (move_uploaded_file($_FILES['fileupload']['tmp_name'], "vattu.jpg"))
{
echo "ok";
}
?>