PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of George Ariton   PHP Valid MIME Type   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Mime class example script
Class: PHP Valid MIME Type
Get the MIME file of file with finfo or file name
Author: By
Last change:
Date: 11 years ago
Size: 214 bytes
 

Contents

Class file image Download
<?php
   
@include_once "Mime.class.php";
   
$file = "image.jpg";
   
$mime = Mime::getInstance();
   
$mimeType = $mime->getMimeType($file);
   
   
header('Content-Type: ' . $mimeType);
    echo
file_get_contents($file);
?>