1
내 사이트의 각 사용자에 대한 업로드 폴더를 만들고 특정 영역에 사진을 표시하려고합니다. 나는 codeigniter 업로드 도우미가 작동하도록 할 수 있었고 파일을 폴더에 업로드 할 수있었습니다.codeigniter에서 사용자가 폴더를 업로드하고 특정 내용을 표시하는 방법은 무엇입니까?
특정 사용자가 업로드 한 사진이
자동 크기 두 사진을 자신의 아이디로 특정 즉석에서 만든 사용자의 폴더에 저장 한 :에 지금은 할 수 있도록하려면 크기. 썸네일과 큰 크기
나는 그것이 내가 단지를 연결하는 방법을 알고하지 않는 일을 수행하는 방법에 대한 연구에서 설정이 생각하는 자신의 ID의 구문뿐만 아니라 폴더를 생성 및 업로드 등 .
마지막 단계는이 사진을 내 ID 위치에 연결된 위치에 표시하는 것입니다.
여기 내 컨트롤러
public function upload()
{
mkdir('./upload/' . $this->session->userdata('id'), 0777);
$config['image_library'] = 'gd2';
$config['source_image'] = 'PATH TO FOLDER??';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if (! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$data['main_content'] = 'account/upload';
$this->load->view('includes/templates/main_page_template', $data);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
입니다. 감사! – LightningWrist
그러나 정상적으로 작동합니다. "심각도 경고 : mkdir() [functon.mkdir] : 파일이 있습니다. – LightningWrist
디렉토리를 생성하기 전에 디렉토리가 존재하는지 확인하십시오. 응답을 업데이트 할 것입니다. – stormdrain