CSV download does not work Magento 1.9.2.3

I created a module in magento to export some user data for the client on an excel sheet and when the user clicks on the link that he used to export and download, but now he suddenly stopped working. I see that the file is being created in my var folder, but it does not load at all

$csv->saveData($fileName, $customersArray); $this->_prepareDownloadResponse($fileName, array('type' => 'filename', 'value' => $fileName)); $this->loadLayout(); $this->_title($this->__("Customer Export")); $this->renderLayout(); 
+5
source share
1 answer

What is the file size?

As you said, you can see the file created in your var folder, but the user cannot load it, perhaps this is due to the settings of PHP or the web server.


Regarding php configuration, try updating php.ini with

 Upload_max_filesize = 1500 M Max_input_time = 1000 Memory_limit = 640M Max_execution_time = 1800 Post_max_size = 2000 M 

Save php.ini and reboot the server.

source: this answer


If it is not a server, you can 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 can also add or modify the .htaccess file in the download directory ( /var/download ) as follows:

 <Files *.*> ForceType applicaton/octet-stream </Files> 
0
source

Source: https://habr.com/ru/post/1275594/


All Articles