From 33229e74b84115657bbedc075386969aad3d535e Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 3 Oct 2008 02:26:43 +0000 Subject: [PATCH] Updated file functions to use HTTPRequest::send_file git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63583 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/GenericDataAdmin.php | 2 +- code/StaticExporter.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/GenericDataAdmin.php b/code/GenericDataAdmin.php index c0fbbc60..e979114e 100755 --- a/code/GenericDataAdmin.php +++ b/code/GenericDataAdmin.php @@ -477,7 +477,7 @@ HTML; $fileData .= "\n"; } - HTTP::sendFileToBrowser($fileData, $fileName); + return HTTPRequest::send_file($fileData, $fileName); } else { user_error("No records found", E_USER_ERROR); } diff --git a/code/StaticExporter.php b/code/StaticExporter.php index 8618e00a..34c2bda5 100755 --- a/code/StaticExporter.php +++ b/code/StaticExporter.php @@ -92,8 +92,7 @@ class StaticExporter extends Controller { $content = file_get_contents("/tmp/static-export/$baseFolder.tar.gz"); Filesystem::removeFolder('/tmp/static-export'); - HTTP::sendFileToBrowser($content, "$baseFolder.tar.gz"); - return null; + return HTTPRequest::send_file($content, "$baseFolder.tar.gz"); } else { echo _t('StaticExporter.ONETHATEXISTS',"Please specify a folder that exists");