php - File permission with upload class of CodeIgniter -



php - File permission with upload class of CodeIgniter -

hi need set permission 777 uploaded files dont find docs uploaded files in codeigniter... possible set permission 777 upload class of codeigniter ??

$group_id = $this->input->post('group_id', true);

// unlink('static/images/uploads/44'); // rmdir('static/images/uploads/45'); $dir = is_dir('../www/static/images/uploads/'.$group_id); if($dir){ $config['upload_path'] = '../www/static/images/uploads/'.$group_id; echo "test"; } else{ mkdir('../www/static/images/uploads/'.$group_id, 0777); $config['upload_path'] = '../www/static/images/uploads/'.$group_id; } $config['allowed_types'] = 'docx|pdf|doc|gif|jpg|png|tiff'; $config['max_size'] = '10000000'; $config['max_width'] = '999999'; $config['max_height'] = '99999'; $this->load->model('teacher_model'); $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); print_r($error); //$this->load->view('school/teacher/upload_form', $error); } else { $data = array('upload_data' => $this->upload->data()); $name = $this->input->post('name', true); $path = $data['upload_data']['file_name']; $group_id = $this->input->post('group_id', true); $this->teacher_model->add_ressources($group_id,$name,$path); redirect('school/teachers/#tabs_group_ressource'.$group_id, 'location', 301); }

you can utilize chmod alter permissions. may work. after do_upload seek adding next line

if(is_file($config['upload_path'])) { chmod($config['upload_path'], 777); ## should alter permissions }

php codeigniter

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -