I uploaded my image using codeigniter, uploaded images not displaying in my website, then i went filezilla and searched about that file, the folder permission is 755 but file permission is 600, if i change the file permission to 644, then image displays fine, but i cann't do like this for all uploading images. so, is there any way to fix it?
$config['upload_path'] = './assets/images/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '600';
$config['max_height'] = '600';
$config['file_name'] = $id;
$this->load->library('upload');
$this->upload->initialize($config);
if(!$this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
redirect('', $error);
}
else
{
chmod($config['upload_path'], 0755);
redirect('');
}