2

what can be the other option I can try to upload a file in codeigniter on live server.

I am uploading .ini on my server, but I get this error:

A PHP Error was encountered

Severity: Warning

Message: escapeshellarg() has been disabled for security reasons

Filename: libraries/Upload.php

Line Number: 1039

Now after looking at this links:

escapeshellarg

EscapeshellARG

on community they suggest making changes in PHP.ini file. But in my case i cannot access it as we are on shared server.

So what is the possible alternative to upload a file in codeigniter?

This is my upload code:

function do_upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = '*';

        $this->load->library('upload', $config);
        $this->upload->initialize($config);


        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());

            $this->load->view('customer/upload/upload_ini', $error);
        }
        else
        {

            $data = array('upload_data' => $this->upload->data());

            $id = $this->session->userdata('id');

            foreach ($data as  $row) 
            {
                $file_name = $row['file_name'];
                $file_path = $row['file_path'];

            }

            $site = $this->session->userdata('site');
                 $insert_data = array(
                    'customer_id' => $id,
                    'base_ini_filename' => $file_name,
                    'file_path'=>$file_path,
                    'site_key'=>$site
                     );

                $this->db->insert('base_ini', $insert_data);

                redirect('customer/upload_ini/index');

                $this->data['subview'] = 'customer/upload/upload_success';
                $this->load->view('customer/_layout_main', $this->data);
        }
Community
  • 1
  • 1
Rajan
  • 2,427
  • 10
  • 51
  • 111

0 Answers0