Welcome Guest, Not a member yet? Register   Sign In
Error on uploading file
#1

[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.
#2

[eluser]InsiteFX[/eluser]
php.ini
Code:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 256M

InsiteFX
#3

[eluser]Sudz[/eluser]
[quote author="InsiteFX" date="1304016178"]php.ini
Code:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 256M

InsiteFX[/quote]





Thank you very much boss, it works.




Theme © iAndrew 2016 - Forum software by © MyBB