Explorar o código

Support the download of "bigger-than-memory" backup files.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3809 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=9) %!d(string=hai) anos
pai
achega
e56673f013
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      setup/backup.class.inc.php

+ 8 - 5
setup/backup.class.inc.php

@@ -367,11 +367,14 @@ class DBBackup
 	 */	
 	public function DownloadBackup($sFile)
 	{
-		$oP = new ajax_page('backup');
-		$oP->SetContentType("multipart/x-zip");
-		$oP->SetContentDisposition('inline', basename($sFile));
-		$oP->add(file_get_contents($sFile));
-		$oP->output();
+		header('Content-Description: File Transfer');
+		header('Content-Type: multipart/x-zip');
+		header('Content-Disposition: inline; filename="'.basename($sFile).'"');
+		header('Expires: 0');
+		header('Cache-Control: must-revalidate');
+		header('Pragma: public');
+		header('Content-Length: '.filesize($sFile));
+		readfile($sFile);
 	}
 
 	/**