popUserContext(); CRM_Utils_System::redirect($toUrl); } } else { CRM_Utils_System::download( CRM_Utils_File::cleanFileName(basename($path)), $mimeType, $buffer ); } } }