Mime-type checkBefore to upload a file, your component checks the coherency of the header of a file. It should match with its own known mime-types / extensions pairs. Mime detectionThere are severals possibles ways to detect mime in php. Your component is trying the one it found possible, but it depends of your server configuration. switch($method) { case 'system': if (!function_exists('system')) continue; $mime = system("file -i -b " . $file); break; case 'shell_exec': if (!function_exists('shell_exec')) continue; $mime = trim( @shell_exec( 'file -bi ' . escapeshellarg( $file ) ) ); break; case 'mime_content_type': if (!function_exists('mime_content_type')) continue; $mime = mime_content_type($file); break; case 'finfo_file': if (!function_exists('finfo_file')) continue; $finfo = finfo_open(FILEINFO_MIME); $mime = finfo_file($finfo, $file); finfo_close($finfo); break; case 'image_check': $file_info = getimagesize($file); $mime = $file_info['mime']; break; }
TroubleshootingSpecific file or extensionIf it fails only with a certain type of files, then the problem do not comes from your component. Always failsIf your component always fails to read a mime header: 1. Check your php modules. 2. Disable Mime detection. |
|
Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs.
One word: Awesome.