# Upload a new fileif ($file && !empty($_FILES['upfile']) && $file->editable && $core_media_writable)
{
try {
files::uploadStatus($_FILES['upfile']);
$newfile=date("YmdHis").$info['extension'];
$f_title = (isset($_POST['upfiletitle']) ? $_POST['upfiletitle'] : '');
$core->media->uploadFile($_FILES['upfile']['tmp_name'],$newfile,$f_title,false,true);
http::redirect($page_url.'&id='.$id.'&fupl=1');
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
}