How to get the mime type of a file after using file_get_contents from a remote server
i'm reading a file from php from Alfresco and then outputting it to the browser. The only ptoblem is the mimetype or the extension of the file. This is the code i'm using: <?php ob_start(); //require_once("libs/FirePHPCore/fb.php"); require_once("libs/AlfrescoConnect.php"); $nomeFile = rawurldecode($_GET['nomeFile']); $urlDownload = $_GET['urlDownload']; $fileDownloadUrl = AlfrescoConnect::$serverPath. $urlDownload . "&attach=true&alf_ticket=".AlfrescoConnect::getTiket(); fb($fileDownloadUrl); $cnt = file_get_contents($fileDownloadUrl); header("Content-type: Application/octet-stream"); header(