session_id(), // Session-ID 'font' => '@'.$_FILES['font']['tmp_name'], // temporary file name after upload 'submit' => 1, // flag !!!must!!! be put 'name' => $_FILES['font']['name'] // original name of *.ttf file ); curl_setopt($ch, CURLOPT_URL, 'http://update.webdynamics.de/fonts.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $aData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return from plan-i server $sReturn = curl_exec($ch); // Files successfull created? if(eregi('Font file compressed', $sReturn) && eregi('Font definition file generated', $sReturn)) { // Your folder where you would like to save the provided files + file name without .ttf $sName = str_replace('.ttf','',$_FILES['font']['name']); $sDir = '/fpdf/fonts/'.$sName; $sTmpFile = 'http://update.webdynamics.de/fonts.php?filename='.session_id().'_'.$sName; // Create the 3 files on your server file_put_contents($sDir.'.afm', str_replace(session_id().'_', '', file_get_contents($sTmpFile.'.afm', FILE_BINARY))); file_put_contents($sDir.'.z', str_replace(session_id().'_', '', file_get_contents($sTmpFile.'.z', FILE_BINARY))); file_put_contents($sDir.'.php', str_replace(session_id().'_', '', file_get_contents($sTmpFile.'.php', FILE_BINARY))); } ?>