0
내가 업로드 된 이미지 크기를 조정하고CodeIgniter의 이미지 크기를 조정하고 원격 서버에 저장
내가 성공적으로 다음을 수행 할 수 원격 서버에 저장하는 내가 사용하는 CodeIgniter의 싶어 프로젝트가 (내 로컬 컴퓨터에있는 모든) :
- 은 최종 목적지 폴더에 저장되는 TMP 폴더
- 에서 이미지를 크기를 조정 TMP 폴더
- 에 저장되는 업로드 된 이미지
- 를 얻을.
그러나, 나는 한 단계 더 만들고 싶어. 내가 tmp에서 이미지를 얻으려면 크기를 조정하고 원격 서버에 저장하십시오. 여기에 그것이 작동하지 않을 것이라고 가정 샘플 코드입니다.
$config['image_library'] = 'gd2';
$config['source_image'] = '/tmp/sample.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 80;
$config['height'] = 60;
$config['new_image'] = 'ftp://xx.xx.xxx.xxx/tmp/sample.jpg'; // can i do this?
$config['thumb_marker'] = '';
$ftpconfig['hostname'] = 'xx.xx.xxx.xxx';
$ftpconfig['username'] = 'name';
$ftpconfig['password'] = 'password';
$ftpconfig['debug'] = TRUE;
$this->ftp->connect($ftpconfig);
// and can I call CI to resize it and save to a ftp server after connent ftp?
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();
$this->ftp->close();
http://stackoverflow.com/questions/13154787/image-resize-before-uploading-in-codeigniter-php/13155566#13155566이 내 대답을 확인, 당신도 거기에 코멘트를 읽어 들일 필요가 있습니다. 그것은 당신이 원하는 것을합니다. –