Download getLastImage.php from fenkod2001/docsnap-smart-document-scanner: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/spaces/fenkod2001/docsnap-smart-document-scanner/resolve/main/getLastImage.php
- Command line
-
hf download hf://spaces/fenkod2001/docsnap-smart-document-scanner/getLastImage.php
-
curl -L -o getLastImage.php https://huggingface.co/spaces/fenkod2001/docsnap-smart-document-scanner/resolve/main/getLastImage.php
458 Bytes
| php | |
| header('Content-Type: application/json'); | |
| $uploadDir = 'uploads/'; | |
| $files = glob($uploadDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE); | |
| if (count($files) > 0) { | |
| // Sort by modification time (newest first) | |
| usort($files, function($a, $b) { | |
| return filemtime($b) - filemtime($a); | |
| }); | |
| $latestFile = $files[0]; | |
| echo json_encode(['imageUrl' => $latestFile]); | |
| } else { | |
| echo json_encode(['imageUrl' => null]); | |
| } | |
| </html> |