I am stuck in uploading file in rest api in codeigniter. continously am getting the error. You do not select a file to upload
$config['upload_path'] = $url.'public/images/users_pictures/';
$config['allowed_types'] = 'jpg|jpeg|png|gif';
$config['max_size'] = '10096000';
$config['max_height'] = '3648';
$config['max_width'] = '6724';
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('file'))
{
// $this->upload->do_upload('cover');
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
$this->db->set(array('user_image' => $picture));
$this->db->where('user_id',$uid);
$update = $this->db->update('asm_register');
return $update;
}
else
{
echo $error = $this->upload->display_errors();
return "";
}
print_r($_FILES)is unpopulated. the issue is elsewhere in your code. how are you uploading?