Jump to content

How does one get mime-type checking working under Win32?


dead_elves

Recommended Posts

Hi,

 

The first challenge was actually finding a magic.mime file on my PC. No luck there, (there is a file called 'magic' in the Apache folder, but it didn't look right) so I finally managed to download one off-of a similar question here. I've attached it in case it turns out to be the wrong file.

 

I then tried placing it everywhere: The site's root directory under 'htdocs'; my own env folder pointed to by the MAGIC env variable (c:\_usr\_env\magic.mime); the root of my php installation, pointed at by an entry in my php.ini: "mime_magic.magicfile="C:\Program Files\PHP\magic". I tried this both with and without ".mime" at the end, following advice I found on the php site.

 

I tried both the 'mime_content_type' function and the 'finfo_open' functions, the latter by turns pointing at every location described above, all, or none at all.

 

No matter what I try, I keep getting "Failed to load magic database at ..." pointing to whatever location I specify, or '(null)', if I don't specify a location. 'mime_content_type' simply does nothing.

 

Assuming I get this working, there's still the concern that wherever it gets hosted won't have these extensions installed either. Are there any alternatives that are part of the core php installation?

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.