/ Published in: PHP

This is a function to retrieve the mime-type of a file by checking the header response with curl. It accepts the file-path as a parameter & it also has a fallback for empty returns.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function file_mime($_path) { $mime = $content_parts[0]; $get_info = new finfo; return $mime; } else { $mime = 'application/octet-stream'; return $mime;} }
Comments
