<?php
function mime_type($mime) {
  switch($mime) {

    case 'image/gif': 
    case 'image/jpeg' : 
    case 'image/tiff': 
    case 'image/bmp': 
    case 'image/pjpeg': 
    case 'image/x-png': 
    case 'image/x-xbitmap' : return 'img.gif'; 

    case 'application/pdf': return 'pdf.gif';
    case 'application/excel' : 
    case 'application/msexcel' : return 'excel.gif';
    case 'application/word' : 
    case 'application/msword' : return 'word.gif';
    case 'application/powerpoint' : 
    case 'application/mspowerpoint' : return 'ppt.gif';
    case 'application/x-msacces' : return 'mdb.gif';

    default: return 'otros.gif'; 
  }

}
