I have searched through the community and found that adding :
$cmd = 'file --brief --mime ' . @escapeshellarg($file['tmp_name']) .
might solve the issue but it has not.
I am trying to upload a file in Codeginter PHP.
I have developed an application that works fine on my local machine, I was able to upload files but then I moved it to live server.
Now I am getting an error :
A PHP Error was encountered
Severity: Warning
Message: escapeshellarg() has been disabled for security reasons
Filename: libraries/Upload.php
Line Number: 1039
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/primeasp/public_html/bizlnps_prov/system/core/Exceptions.php:186)
Filename: helpers/url_helper.php
Line Number: 543
But it has not so I have posted here.
Why am I getting this error? And how will i be able to solve it?
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);
}