Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
<?php
session_start();
if( !isset($_GET['file']) ) {
header($_SERVER['SERVER_PROTOCOL'].' 412 Precondition Failed');
exit;
}
if( $_GET['file'] != basename($_GET['file']) ) {
header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden');
exit;
}
$absPath = $_SERVER['DOCUMENT_ROOT'].'/web/'.$_SESSION['benutzername'].'/'.basename($_GET['file']);
if( file_exists($absPath) ) {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
exit;
}
$imageTypes = array(null, 'image/gif', 'image/jpg', 'image/png', 'application/x-shockwave-flash');
if( !($info = getimagesize($absPath)) || !isset($imageTypes[$info[2]]) ) {
header($_SERVER['SERVER_PROTOCOL'].' 406 Not acceptable');
exit;
}
header('Content-Type: '.$imageTypes[$info[2]]);
readfile($absPath);
exit;