473,804 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mime_content_ty pe() returns empty string for AVI using PHP5

PHP 5.2.0

when using mime_content_ty pe("/path/to/my/video.avi")

I get an empty string every time

When I am supposed to get

video/x-msvideo

What is going on?

Thanks
Phil

Jul 4 '07 #1
3 2843
Rik
On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
<ph************ **@gmail.comwro te:
PHP 5.2.0

when using mime_content_ty pe("/path/to/my/video.avi")

I get an empty string every time

When I am supposed to get

video/x-msvideo

What is going on?
http://www.php.net/mime_content_type

"..as determined by using information from the _magic.mime_ file.."

which is by no means 100%, or even very reliable.

Also:
"This function has been deprecated as the PECL extension Fileinfo provides
the same functionality (and more) in a much cleaner way."

http://www.php.net/manual/en/ref.fileinfo.php

HTH,
--
Rik Wasmus
Jul 4 '07 #2
On Jul 4, 4:48 am, Rik <luiheidsgoe... @hotmail.comwro te:
On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php

<phillip.s.pow. ..@gmail.comwro te:
PHP 5.2.0
when using mime_content_ty pe("/path/to/my/video.avi")
I get an empty string every time
When I am supposed to get
video/x-msvideo
What is going on?

http://www.php.net/mime_content_type

"..as determined by using information from the _magic.mime_ file.."

which is by no means 100%, or even very reliable.
Considering there's an entry for AVI in magic.mime for PHP and for
Apache. :(
>
Also:
"This function has been deprecated as the PECL extension Fileinfo provides
the same functionality (and more) in a much cleaner way."

http://www.php.net/manual/en/ref.fileinfo.php
Hmm.. might be an option thanx!
>
HTH,
--
Rik Wasmus

Jul 4 '07 #3
On Jul 4, 11:03 am, "comp.lang. php" <phillip.s.pow. ..@gmail.com>
wrote:
On Jul 4, 4:48 am, Rik <luiheidsgoe... @hotmail.comwro te:
On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
<phillip.s.pow. ..@gmail.comwro te:
PHP 5.2.0
when using mime_content_ty pe("/path/to/my/video.avi")
I get an empty string every time
When I am supposed to get
video/x-msvideo
What is going on?
http://www.php.net/mime_content_type
"..as determined by using information from the _magic.mime_ file.."
which is by no means 100%, or even very reliable.

Considering there's an entry for AVI in magic.mime for PHP and for
Apache. :(
Also:
"This function has been deprecated as the PECL extension Fileinfo provides
the same functionality (and more) in a much cleaner way."
http://www.php.net/manual/en/ref.fileinfo.php

Hmm.. might be an option thanx!
Sorry I was wrong, not an option. Apparently it relies upon /etc/
magic.mime, which of course there is no Windows equivalent, nor does
it seem that PECL's fileinfo have any Windows support according to the
user notes that I could find
>

HTH,
--
Rik Wasmus

Jul 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
14767
by: Randell D. | last post by:
Does mime_content_type() require anything to be pre-compiled? I'm using PHP4.3.3 with Apache 1.3.28 and the man/help page in the latest php.chm windoze file doesn't mention any pre-requisites... all help is appreciated, thanks -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing?
3
8903
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns a empty value instead of returning the browser type. Here is the line which i am using in my code and from manual: <?php echo $_SERVER; ?>
5
8231
by: build | last post by:
G'day All, I have a problem with this loop. There are a number of .txt files in 'myPath'. tmpFile = Dir(myPath & "\*.txt") 'PROCESS FOLDER Do Until tmpFile = "" <lottsa code> <too much to post> tmpFile = Dir
3
5292
by: comp.lang.php | last post by:
PHP 4.3.8 with UNIX with option --with-magic_mime echo mime_content_type('/images/myimage.png'); // RETURNS "text/plain" PHP 4.3.11 with UNIX with option --with-magic_mime echo mime_content_type('/images/myimgae.png'); // RETURNS "text/plain"
10
4739
by: comp.lang.php | last post by:
echo mime_content_type('/var/www/html/video/small.mov'); // 1.5mb Quicktime video returns "video/quicktime" echo mime_content_type('/var/www/html/video/huge.mov'); // 10.5mb Quicktime video returns "text/plain" Environment: PHP 5.0.4 - Windows XP --enable-mime-magic PHP 4.3.11 - Fedora Core 4 --enable-mime-magic
13
3237
by: Noa | last post by:
Hi I have a page that looks like that: <form name="kuku1" action ="anotherpage.html" > <input name="name"> <input name="kuku2"> </form> As far as i know, "getAttribute" should return a string value of an
1
6552
by: dave | last post by:
I am having a problem i bleieve a number of other individuals have had before. I have tried the solutions found on the net however I still have the problem. I am hosting a web site on an external server (i do not have access to registry). I am using the following connection string to read values from rows from an excel sheet into a dataset/datatable. One of the columns contains alpha-numeric values ie. 400c
0
1557
by: Markus Ernst | last post by:
Hi In an application installed with PHP5 it looks like ftp_nlist() returns false if the directory is empty, instead of an empty array as it should according to the manual. On the original server with PHP4 it works as expected. Is this a bug, or an undocumented change in PHP5, or a setting that could be changed somewhere?
5
2642
by: Travis | last post by:
I am using a function that returns a const char * that is usually a word, etc. How can I check to see if what it returns is empty? I tried if (function() == "") and (function() == NULL) and (function() == '/0'). But then I see that the those if statements are flagging true when the function returns back a char * or no length
0
10568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10311
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.