Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-31 Thread Ashley Sheridan
On Thu, 2009-07-30 at 21:26 -0400, b wrote: On 07/30/2009 10:15 AM, Ashley Sheridan wrote: On Thu, 2009-07-30 at 07:12 -0700, Christoph Boget wrote: You could email it to me, which I presume is better if you replied back just to me and not the list? Just copying the list back on in

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Christoph Boget
/usr/share/file/magic /usr/share/file/magic has lots of rules to know its type and its just matching it. I know it has a lot of rules. Grepping it for excel shows that there are rules in it for those types of files as well. Maybe your file is quite strange . have you tried with other xls

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Peter Ford
Christoph Boget wrote: /usr/share/file/magic /usr/share/file/magic has lots of rules to know its type and its just matching it. I know it has a lot of rules. Grepping it for excel shows that there are rules in it for those types of files as well. Maybe your file is quite strange . have

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread b
On 07/30/2009 08:53 AM, Peter Ford wrote: Have you tried using 'file -i' from the command line: after all you are looking for a MIME type with your fileinfo... Having said that, with file -i on my system, Word documents are 'application/msword' and Excel files are 'application/octet-stream'

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Christoph Boget
Have you tried using 'file -i' from the command line: after all you are looking for a MIME type with your fileinfo... Having said that, with file -i on my system, Word documents are 'application/msword' and Excel files are 'application/octet-stream' $ file -i excel.xls excel.xls:

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Christoph Boget
Having said that, with file -i on my system, Word documents are 'application/msword' and Excel files are 'application/octet-stream' Fedora11 (2.6.29.6-213.fc11.i586) $ file excel.xls excel.xls: CDF V2 Document, Little Endian, Os: Windows, Version 5.1, Code page: 1252, Author:

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Ashley Sheridan
On Thu, 2009-07-30 at 09:51 -0400, Christoph Boget wrote: Having said that, with file -i on my system, Word documents are 'application/msword' and Excel files are 'application/octet-stream' Fedora11 (2.6.29.6-213.fc11.i586) $ file excel.xls excel.xls: CDF V2 Document, Little Endian, Os:

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Christoph Boget
The xls file I am using was generated with Excel (of Office 2007) for the Mac.  So either you have a different magic file (assuming that's what the file command uses) than I do or different versions of excel contain different information. I just tried using an excel spreadsheet saved using

RE: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Bob McConnell
From: Christoph Boget Have you tried using 'file -i' from the command line: after all you are looking for a MIME type with your fileinfo... Having said that, with file -i on my system, Word documents are 'application/msword' and Excel files are 'application/octet-stream' $ file -i

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread Ashley Sheridan
__ From: Ashley Sheridan a...@ashleysheridan.co.uk To: Christoph Boget jcbo...@yahoo.com Sent: Thursday, July 30, 2009 10:05:33 AM Subject: Re: [PHP] fileinfo returning wrong mime type for Excel files On Thu, 2009-07-30 at 07:04 -0700, Christoph Boget wrote: To test

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-30 Thread b
On 07/30/2009 10:15 AM, Ashley Sheridan wrote: On Thu, 2009-07-30 at 07:12 -0700, Christoph Boget wrote: You could email it to me, which I presume is better if you replied back just to me and not the list? Just copying the list back on in this one now. I don't know of any places that you

[PHP] fileinfo returning wrong mime type for Excel files

2009-07-29 Thread Christoph Boget
Consider the following: $finfo = finfo_open( FILEINFO_MIME, '/usr/share/file/magic' ); if( $finfo ) { $mimeType = finfo_file( $finfo, '/path/to/my/excel.xls' ); finfo_close($finfo); } echo $mimeType; When I run the above, it echoes out

Re: [PHP] fileinfo returning wrong mime type for Excel files

2009-07-29 Thread Paul M Foster
On Wed, Jul 29, 2009 at 05:15:38PM -0400, Christoph Boget wrote: Consider the following: $finfo = finfo_open( FILEINFO_MIME, '/usr/share/file/magic' ); if( $finfo ) { $mimeType = finfo_file( $finfo, '/path/to/my/excel.xls' );

[PHP] Fileinfo and MSWord bug

2009-05-16 Thread b
PHP 5.2.6 file-4.17-15.el5_3.1 Fileinfo installed through PECL Checking certain MSWord files, I'm getting back (sans quotes) application/msword application/msword. Someone reported (in the manual comments) this same thing back in 2007: http://ca2.php.net/manual/en/ref.fileinfo.php#79063 Can

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread Thodoris
RHEL5/PHP 5.1.6 I'm having some trouble getting the Fileinfo package working. It installed fine, and phpinfo() says it's enabled. But it consistently returns an empty string when getting the MIME of a file. /usr/share/pear/bin/pecl install fileinfo vi /etc/php.d/fileinfo.ini

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread brian
Thodoris wrote: Is fileinfo pecl extension installed as a package or with pecl? In case it is installed as an rpm try to remove it and install it as an extension in case the package is broken for some reason. I installed it with PECL: /usr/share/pear/bin/pecl install fileinfo Other

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread Thodoris Goltsios
Thodoris wrote: Is fileinfo pecl extension installed as a package or with pecl? In case it is installed as an rpm try to remove it and install it as an extension in case the package is broken for some reason. I installed it with PECL: /usr/share/pear/bin/pecl install fileinfo Other

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread brian
Thodoris Goltsios wrote: Thodoris wrote: Is fileinfo pecl extension installed as a package or with pecl? In case it is installed as an rpm try to remove it and install it as an extension in case the package is broken for some reason. I installed it with PECL: /usr/share/pear/bin/pecl

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread Thodoris
fileinfo.so is, indeed, in /usr/lib/php/modules. But I know it's enabled, in any case. So, anyone know if this extension doesn't work well with 5.1.6? Well you could enable the error messages to see what is going wrong. The $type var is probably empty because the instantiation of the $fi

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread brian
Thodoris wrote: fileinfo.so is, indeed, in /usr/lib/php/modules. But I know it's enabled, in any case. So, anyone know if this extension doesn't work well with 5.1.6? Well you could enable the error messages to see what is going wrong. The $type var is probably empty because the

Re: [PHP] fileinfo on RHEL5

2009-05-13 Thread Michael A. Peters
brian wrote: RHEL5/PHP 5.1.6 I'm having some trouble getting the Fileinfo package working. It installed fine, and phpinfo() says it's enabled. But it consistently returns an empty string when getting the MIME of a file. /usr/share/pear/bin/pecl install fileinfo vi /etc/php.d/fileinfo.ini

[PHP] fileinfo on RHEL5

2009-05-12 Thread brian
RHEL5/PHP 5.1.6 I'm having some trouble getting the Fileinfo package working. It installed fine, and phpinfo() says it's enabled. But it consistently returns an empty string when getting the MIME of a file. /usr/share/pear/bin/pecl install fileinfo vi /etc/php.d/fileinfo.ini

Re: [PHP] Fileinfo

2008-02-05 Thread Mad Unix
I did what you recommended i get the same erorr ;;; ; Resource Limits ; ;;; max_execution_time = 3600 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit =

Re: [PHP] Fileinfo

2008-02-05 Thread Paul Scott
On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote: I did what you recommended i get the same erorr Depending on your distro, you may have 2 php.ini files. On debian based systems there certainly are. One for Apache to use and another for cli. Check that this is not the case first, you may

Re: [PHP] Fileinfo

2008-02-05 Thread Chris
Mad Unix wrote: I did what you recommended i get the same erorr ;;; ; Resource Limits ; ;;; max_execution_time = 3600 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request

Re: [PHP] Fileinfo

2008-02-05 Thread Mad Unix
thanks it works now wget http://pecl.php.net/get/Fileinfo-1.0.3.tgz tar -zxf Fileinfo-1.0.3.tgz cd Fileinfo-1.0.3 phpize ./configure make make install Libraries have been installed in: /usr/local/src/Fileinfo-1.0.3/modules If you ever happen to want to link against installed libraries

Re: [PHP] Fileinfo

2008-02-05 Thread Mad Unix
regarding my horde installation it says NOW memory_limit disabled: No If PHP's internal memory limit is turned on and if not set high enough Horde will not be able to handle large data items (e.g. large mail attachments in IMP). If possible, you should disable the PHP memory limit by recompiling

Re: [PHP] Fileinfo

2008-02-05 Thread Paul Scott
On Tue, 2008-02-05 at 23:13 -0800, Mad Unix wrote: thanks it works now Libraries have been installed in: /usr/local/src/Fileinfo-1.0.3/modules Be sure to remember to add the extension to your php.ini now as well with an extension= line and restart your server for the changes to

Re: [PHP] Fileinfo

2008-02-05 Thread Mad Unix
I have only one file [EMAIL PROTECTED] wv-1.0.3]# find / -name php.ini -print /etc/php.ini On Feb 5, 2008 10:55 PM, Paul Scott [EMAIL PROTECTED] wrote: On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote: I did what you recommended i get the same erorr Depending on your distro, you may

Re: [PHP] Fileinfo

2008-02-05 Thread Mad Unix
[EMAIL PROTECTED] html]# cat /etc/php.ini | grep -i fileinfo extension=fileinfo.so [EMAIL PROTECTED] html]# cat /etc/php.ini | grep -i modules ; Directory in which the loadable extensions (modules) reside. extension_dir = /usr/lib64/php/modules ; Note: packaged extension modules are now loaded

[PHP] Fileinfo

2008-02-04 Thread Mad Unix
I can not install FileInfo... any help [EMAIL PROTECTED] php.d]# pear config-show Configuration (channel pear.php.net): = Auto-discover new Channels auto_discovernot set Default Channeldefault_channel pear.php.net HTTP Proxy Server

Re: [PHP] Fileinfo

2008-02-04 Thread Daniel Brown
On Feb 4, 2008 4:06 AM, Mad Unix [EMAIL PROTECTED] wrote: I can not install FileInfo... any help [snip] Note this line: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to Update the php.ini to use more than 8MB. (See `memory_limit`) While you're at it,