Init PercoVitrine — app de gestion de fiches produits

This commit is contained in:
perco
2026-06-27 10:34:47 +02:00
commit a1b3f6da98
16 changed files with 1158 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
require __DIR__ . '/includes/db.php';
$f = basename($_GET['f'] ?? '');
if (!$f) { http_response_code(400); exit; }
$path = $UPLOAD_DIR . $f;
if (!is_file($path)) { http_response_code(404); exit; }
$ext = strtolower(pathinfo($f, PATHINFO_EXTENSION));
$mime = match($ext) {
'jpg','jpeg' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/gif',
'webp' => 'image/webp',
'avif' => 'image/avif',
'mp4' => 'video/mp4',
'webm' => 'video/webm',
'mov' => 'video/quicktime',
default => 'application/octet-stream',
};
header('Content-Type: ' . $mime);
header('Cache-Control: public, max-age=86400');
header('Content-Length: ' . filesize($path));
readfile($path);