Open( $selectedServer, $userInfo ); $logReader = $serverAdmin->GetLogFile( $logFileName ); $serverAdmin->Close(); $theLog = ""; $chunk = ""; do { $chunkSize = $logReader->Read( $chunk, 4096 ); $theLog = $theLog.$chunk; } while ( $chunkSize != 0 ); return $theLog; } // Define Local values $pageName = "DownloadLogPage"; $formName = "DownloadLogForm"; $logFileToDownloadID = 'logFileToDownload'; $logFileToDownload = ""; $selectedServerName = ""; $logContents = ""; $errorMsg = ""; $firstTimeHere = FirstTimeHere( $pageName ); // Get log filename if ( array_key_exists( $logFileToDownloadID, $_GET ) ) $logFileToDownload = $_GET[ $logFileToDownloadID ]; if ( array_key_exists( $logFileToDownloadID, $_POST ) ) $logFileToDownload = $_POST[ $logFileToDownloadID ]; if ( empty( $logFileToDownload ) ) throw new Exception( $errNoLogFileSpecified ); // Get the log contents $logContents = GetLogContents( $logFileToDownload ); $selectedServerName = GetServerName( $selectedServer ); } catch ( MgException $e ) { CheckForFatalMgException( $e ); if ( empty( $errorMsg ) ) $errorMsg = $e->GetMessage(); } catch ( Exception $e ) { if ( empty( $errorMsg ) ) $errorMsg = $e->getMessage(); } ?>