[eluser]Sudz[/eluser]
I am uploading excel file ,
File is uploaded but still giving the following error.
Fatal error: Out of memory (allocated 1572864) (tried to allocate 2002945 bytes) in ..\system\libraries\Zip.php on line 249.
Code:
function do_upload()
{
$config['upload_path'] = './user_data/';
$config['allowed_types'] = 'xls|csv|xlsx|rar';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('file'))
{
$para['message']= $this->upload->display_errors();
$this->load->view('view', $para);
}
else
{
$upload_data = $this->upload->data();
$this->zip_file($upload_data['full_path']);
}
}
//After uploading file I need to zip it and allow to download file.
function zip_file($path)
{
$this->load->library('zip');
$this->zip->read_file($path);//path of file to be zipped
$this->zip->download('uploadfile.zip');
}
please help.