Jump to content

Image upload & mac servers


Recommended Posts

Not sure if this has been seen before or not, but I was having issues getting the image upload to work.

I figured out it had to do with the fact that I am doing my development on a mac server, and the mime_content_type exec() replacement function wasn't working. Here's what I did to fix:

In get-file.php and images.inc.php, replace:

elseif (function_exists('exec')) 
   $mime_type = trim(@exec('file -bi '.escapeshellarg($file)));



with

elseif (function_exists('exec')) {
   if (strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh") !== false) $mime_type = trim(exec('file -b --mime '.escapeshellarg($file)));
   else $mime_type = trim(@exec('file -bi '.escapeshellarg($file)));
}

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...