$error) {
if ($error) {
switch($error) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
echo "The uploaded file exceeds the upload_max_filesize directive in php.ini."; break;
case UPLOAD_ERR_PARTIAL:
echo "The uploaded file was only partially uploaded."; break;
case UPLOAD_ERR_NO_FILE:
break;
case UPLOAD_ERR_NO_TMP_DIR:
echo "Missing a temporary folder."; break;
default:
echo "Unknown error";
}
continue;
}
$weight = "normal";
$style = "normal";
switch($name) {
case "bold":
$weight = "bold"; break;
case "italic":
$style = "italic"; break;
case "bold_italic":
$weight = "bold";
$style = "italic";
break;
}
$style_arr = array(
"family" => $family,
"weight" => $weight,
"style" => $style,
);
Font_Metrics::init();
if (!Font_Metrics::register_font($style_arr, $data["tmp_name"][$name])) {
echo $data["name"][$name]." is not a valid font file";
}
else {
echo "The $family $weight $style font was successfully installed !
";
}
}
break;
}