idleberg/Bootstrap-Listr

getting Fatal Error Out of memory in index.php on line 80

Opened this issue · 0 comments

Prerequisites

  • Are you running the latest version of Bootstrap Listr (stable or alpha/beta)?
  • Did you check your browser's console for errors? See how in Chrome, Firefox, Edge)
  • Did you build a distribution? Use npm run build
  • Are you running the Node v6 (or higher)?
  • Did you check the FAQ?
  • Did you perform a cursory search to see if your issue has already been reported?

Description

i run a file downloading server, which is designed using php, i had used the src code from here to allow users to see the files and download through a webpage,
the problem after running the code is users are able to download files of size lesser then 700 mb and files of size above 1.5gb
users are getting an error message while trying to download files of size between 700mb and 1.5gb, this is common across the different servers that i have.
please help me to over come this peculiar problem
code from Index.php :

if(substr($navigation_dir, -1) != "/"){
if(file_exists($navigation_dir)){

    // GET MIME 
    $mime_file = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $navigation_dir);
    
    // Direct download
    if($mime_file == "inode/x-empty" || $mime_file == ""){
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.basename($navigation_dir).'"');
    }
    // Recognizable mime
    else{
        header('Content-Type: ' . $mime_file);
    }
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Accept-Ranges: bytes');
    header('Pragma: public');
    header('Content-Length: ' . filesize($navigation_dir));
    ob_clean();
    flush();
    if ($options['general']['read_chunks'] == true) { 
        readfile_chunked($navigation_dir);
    } else {
        readfile($navigation_dir);     
    }  
} else {
    set_404_error();
}
exit;

} else {
if(!file_exists($navigation_dir)){
set_404_error();
exit;
}
}

Steps to reproduce

Console Errors (optional)

# your log messages

<br />
<b>Fatal error</b>:  Out of memory (allocated 524288) (tried to allocate 1044185088 bytes) in <b>C:\xampp\htdocs\pcgames\server1\AK\index.php</b> on line <b>80</b><br />

**Expected behavior:**

To download all file types and all sizes of files

**Actual behavior:**

Not able to download files of size between 700mb to 1.5gb, 
I am able to download files of size below 700mb and files of size above 1.5gb

## Versions

* Bootstrap Listr
* PHP
* Node
* npm
* [browser] Crome
* [server] windows server 2008 r2