$file_path = "/path/to/file/document.pdf"; $file_name = "document.pdf"; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($file_path).'"'); header('Content-Length: ' . filesize($file_path)); readfile($file_path); exit;
$image_path = "/path/to/image/image.jpeg"; $image_type = "image/jpeg"; header('Content-Type: '.$image_type); readfile($image_path); exit;In this example, we use the deliverData() function to display an image inline in the browser. We set the header for the Content-Type, specifying the type of image (in this case, JPEG), and use the readfile() function to output the image content to the browser. Package Library: The ilUtil package is part of the ILIAS framework, an open-source learning management system (LMS) developed in PHP. Therefore, the package is specific to ILIAS and is not available as a standalone package in the PHP library.