Dev CodeIgniter 업로드 라이브러리에서 파일 해시로 업로드하자 by ryush00 2014. 8. 2. set_filename를 찾아 아래와 같이 바꿔줍니다. public function set_filename($path, $filename) { if ($this->encrypt_name == TRUE) { $filename = hash_file('sha256', $this->file_temp).$this->file_ext; } return $filename; } do_upload에 아래 줄을 찾아 if ($this->overwrite == FALSE) { $this->file_name = $this->set_filename($this->upload_path, $this->file_name); if ($this->file_name === FALSE) { return FALSE; } } 아래와 같이 바꿔줍니다. //if ($this->overwrite == FALSE) //{ $this->file_name = $this->set_filename($this->upload_path, $this->file_name); if(file_exists($this->upload_path. $this->file_name)) { $this->set_image_properties($this->upload_path.$this->file_name); return TRUE; } //if ($this->file_name === FALSE) //{ // return FALSE; //} //} 사용법: 간단합니다. encrypt_name를 true로 해놓고 그냥 업로드하면 됩니다. 공유하기 게시글 관리 구독하기말똥이의 블로그 관련글 Windows SDK 설치시 5100 오류 발생시 해결방법 Node.js npm 사용시 nodejs/windows Error: ENOENT, stat 오류 해결하기. 우분투 자바 설치 방법 SSH 접속 방법 댓글
댓글