Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

magento large size downloadable product not downloading

I am working on magneto 1.8 CE . Every thing is working fine beside some products are not downloading completely.

Size of these products are greater then 50M.

I change my php.ini settings

Current values are

max_execution_time = 5000   
safe_mode = off
max_input_time = 9000
memory_limit = 1024M
post_max_size = 550M
file_uploads = On
upload_max_filesize = 512M
max_file_uploads = 200
allow_url_fopen = On

Also I changed admin session value to 3600 and Cookie Lifetime to 3600.

Product type are epub books and they are downloading completely on system browser while not downloading completely on mobile/tab/ipad browser's.

How can I fix that issues?

Thanks

like image 873
Trilok Gupta Avatar asked Jan 25 '26 05:01

Trilok Gupta


1 Answers

Cannot say for sure if it is your server's configuration or PHP's configuration. But to test what is causing the problem, place your product at your server's root directory and try downloading your file using a PHP script:

$file = 'PATH_TO_YOUR_FILE';
$baseName = basename($file);
$fileSize = filesize($file);
try {
    $baseName = basename($file);
    header('Content-type: application/force-download');
    header('Content-Transfer-Encoding: Binary');
    header('Content-length: ' . $fileSize);
    header('Content-disposition: attachment; filename="' . $baseName . '"');
    echo file_get_contents($file, true);
    exit(0);
} catch (Exception $e) {
    echo $e->getMessage();
}

Look for any error that might occur. Hope this will help. If not, try checking your magento error log or the server and/or PHP error log for clue.

like image 111
bn00d Avatar answered Jan 26 '26 20:01

bn00d