Files
system0-2.0/sys0-code/api/download_image.php
2024-10-14 12:38:32 +01:00

13 lines
348 B
PHP

<?php
// Get parameters
$username = htmlspecialchars($_GET["username"]);
$printer_url = $_GET["url"];
// Path to save the downloaded image
$path = "/var/www/html/user_files/$username/$printer_url.jpeg";
// Download the latest snapshot from the printer URL
exec("wget --quiet \"http://$printer_url/webcam/?action=snapshot\" -O $path");
?>