Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

php.ini codeigniter

$
0
0
I get this error when upload image

The uploaded file exceeds the maximum allowed size in your PHP configuration file.

How can I in crease can some one tell me where to place it or how to fix it?


PHP Code:
$config['max_size'] = 0

 
Code:
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

PHP Code:
public function upload_attachments() {
        
$data = array();

        
$this->load->library('upload');

        
$upload_data $this->upload->data();

        
$user_id '1';
        
$post_code $this->input->post('post_code');
        
$file_code random_string('alpha'32);
        
$file_name $_FILES['attachment']['name'];
        
$ext pathinfo($file_namePATHINFO_EXTENSION);
        
$date date('Ym');
        
$upload_path FCPATH 'uploads/';

        if (!
is_dir($upload_path $date)) {
            @
mkdir($upload_path $date);
        }

        
$config['upload_path'] = $upload_path $date;
        
$config['file_name'] = 'post_' time() . '_' $file_code;
        
$config['allowed_types'] = 'jpg|png|php|js|html|pdf|css|xml';
        
$config['max_size'] = 0;
        
$config['max_width'] = 0;
        
$config['max_height'] = 0;
        
$config['overwrite'] = TRUE;

        
$this->upload->initialize($config);

        if (!
$this->upload->do_upload('attachment')) {
            
            
$data['upload_errors'] = $this->upload->display_errors();
            
$data['success'] = false;

 
       } else {

 
           $this->load->model('catalog/forum/attachment_model');

 
           if ($this->attachment_model->check_if_code_set($this->input->post('code'))) { 

 
           } else {

 
               $upload_data $this->upload->data();

 
               $data['info'] = $this->upload->data();

 
               $this->attachment_model->new_attachment($post_code$user_id$upload_data);
 
           }

 
           //$data['files'] = $this->newthread_model->get_attachments($post_code);

 
           $data['success'] = true;
 
         }

        echo 
json_encode($data);
    } 


I created a php.ini file and added this

Bud does not change any thing still get error

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>