I have a script setup so users can download files via a php script (one time use link) however when the file size reaches 1GB it fails to download any further.
It stops exactly at 1GB
Is there some setting in php.ini that would allow me to adjust it to go beyound 1GB? I have tried changing most of the settings below but i dont see anything that would relate to a 1GB file size ...
Example: www.url.com/file.php?download=filename.zip (uses the below php code)
<?php
$DownloadableFilesDirectory = "/dl/secret";
$FileRenamePrependCharacters = "odroid_";
if( ! empty($FileRenamePrependCharacters) ) { $FileRenamePrependCharacters =
ltrim($FileRenamePrependCharacters); }
$DownloadableFilesDirectory =
preg_replace('/^\/*/','/',$DownloadableFilesDirectory);
$DownloadableFilesDirectory =
preg_replace('/\/*$/','',$DownloadableFilesDirectory);
$Directory = $_SERVER['DOCUMENT_ROOT'].$DownloadableFilesDirectory;
if( empty($_GET['download']) ) { exit; }
if( empty($_GET['savefile']) ) { $_GET['savefile'] = $_GET['download']; }
$Dfile = $Directory.'/'.$_GET['download'];
$size = filesize($Dfile);
if( ! $size )
{
echo '<p><b>The download file is empty or was not located.</b></p>';
exit;
}
$ctype = 'application/octet-stream';
header('Cache-control: private');
header("Content-Type: $ctype");
header('Content-Disposition: attachment; filename="'.$_GET['savefile'].'"');
header('Content-Transfer-Encoding: binary');
header("Content-Length: $size");
@readfile($Dfile);
if( empty($FileRenamePrependCharacters) ) { unlink($Dfile); }
else
{
$pieces = explode('/',$Dfile);
$pieces[count($pieces)-1] = $FileRenamePrependCharacters .
$pieces[count($pieces)-1];
rename($Dfile,implode('/',$pieces));
}
exit;
?>