Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2013-12-13 21:36
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);
?>