I had created a module in magento to export some custom data for customer in excel sheet and when the user clicks on link it used to get exported and downloaded but now its stopped working suddenly. I see the file being created in my var folder but its not getting downloaded whatsoever
$csv->saveData($fileName, $customersArray);
$this->_prepareDownloadResponse($fileName, array('type' => 'filename', 'value' => $fileName));
$this->loadLayout();
$this->_title($this->__("Customer Export"));
$this->renderLayout();
What is the file size ?
As you said that you can see the file being created in your var folder but user can't download it, it may probably due to the PHP or web server settings.
Concerning php configuration, try to update your php.ini
file with:
Upload_max_filesize = 1500 M
Max_input_time = 1000
Memory_limit = 640M
Max_execution_time = 1800
Post_max_size = 2000 M
Save your php.ini
and restart your server.
source: this answer
If it is not the server, you may also add this line to your index.php
file (or your main script file):
ini_set('upload_max_filesize', '1500M');
ini_set('memory_limit', '640M');
You may also add or modify the .htaccess
file in the download directory (/var/download
) with this:
<Files *.*>
ForceType applicaton/octet-stream
</Files>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With