content_type

Definition

content_type($name)
file_import/file_import.module, line 273

Code

<?php
function content_type($name) { 
    // Defines the content type based upon the extension of the file 
    $contenttype  = 'application/octet-stream'; 
    $contenttypes = array( 'html' => 'text/html', 
                           'htm'  => 'text/html', 
                           'txt'  => 'text/plain', 
                           'gif'  => 'image/gif', 
                           'jpg'  => 'image/jpeg', 
                           'png'  => 'image/png', 
                           'sxw'  => 'application/vnd.sun.xml.writer', 
                           'sxg'  => 'application/vnd.sun.xml.writer.global', 
                           'sxd'  => 'application/vnd.sun.xml.draw', 
                           'sxc'  => 'application/vnd.sun.xml.calc', 
                           'sxi'  => 'application/vnd.sun.xml.impress', 
                           'xls'  => 'application/vnd.ms-excel', 
                           'ppt'  => 'application/vnd.ms-powerpoint', 
                           'doc'  => 'application/msword', 
                           'rtf'  => 'text/rtf', 
                           'zip'  => 'application/zip', 
                           'mp3'  => 'audio/mpeg', 
                           'pdf'  => 'application/pdf', 
                           'tgz'  => 'application/x-gzip', 
                           'gz'   => 'application/x-gzip', 
                           'vcf'  => 'text/vcf' ); 

    $name = ereg_replace("