Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

finfo_open

(PECL)

finfo_open -- Create a new fileinfo resource

Описание

resource finfo_open ( [int options [, string arg]] )

class finfo {

__construct ( [int options [, string magic_file]] )

}

This function opens a magic database and returns its resource.

Список параметров

options

One or disjunction of more Fileinfo constants.

magic_file

Name of a magic database file, usually something like /path/to/magic.mime. If not specified, MAGIC environment variable is used. If this variable is not set neither, /usr/share/misc/magic is used. .mime and/or .mgc is added if appropriate.

Возвращаемые значения

Returns a magic database resource on success or FALSE on failure.

Смотрите также

finfo_close()



finfo_set_flags> <finfo_file
Last updated: Fri, 26 Jan 2007
 
add a note add a note User Contributed Notes
finfo_open
ian at createanet dot co dot uk
02-Nov-2007 09:50
Couldn't get finfo to return the mimetype in the way expected so i made a function to do it with system()

<?php
function get_mime_type($filepath) {
   
ob_start();
   
system("file -i -b {$filepath}");
   
$output = ob_get_clean();
   
$output = explode("; ",$output);
    if (
is_array($output) ) {
       
$output = $output[0];
    }
    return
$output;
}
?>

hope it works for other people too
aldoh at cableonda dot net
19-Sep-2007 06:43
Here is the exact link for Win32user to the file binary package:

http://sourceforge.net/project/showfiles.php?
group_id=23617&package_id=18878
cs at tequila dot co dot jp
03-Jun-2007 09:13
the "close" method does not exists, as it is the default deconstructior there is no need to call it.
tularis at php dot net
06-May-2007 12:55
On Windows systems people might find that this always returns "application/x-dpkg".
There are 2 ways of solving this problem:
1. Get the mime-magic database file from GnuWin32 at <http://sourceforge.net/projects/gnuwin32/>
2. You can manually "fix" the mime-magic file by editing it and escaping all lines starting with !, thus changing each one to \!

finfo_set_flags> <finfo_file
Last updated: Fri, 26 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571