I'm trying to resize pre-uploaded images and then send them to another server with FTP, but it doesnt seems to be working. The uploading is working fine, the ftp is working fine too but whenever I download the image and check the size it's just the same as the uploaded file.
This is my controller:
if ($this->upload->do_upload())
{
$data = $this->upload->data();
$image = $data['file_name'];
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = './uploads/devices/'.$image;
$config['maintain_ratio'] = TRUE;
$config['width'] = 400;
$config['height'] = 300;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$localPath = './uploads/devices/'.$image;
$remotePath = 'webspace/httpdocs/uploads/devices/'.$image;
$this->load->library('ftp');
$config['hostname'] = '';
$config['username'] = '';
$config['password'] = '';
$config['port'] = 21;
$config['passive'] = TRUE;
$this->ftp->connect($config);
$this->ftp->upload($localPath, $remotePath);
$this->ftp->close();
}
What I want to achieve is upload the image, resize and replace it and upload the resized image after that.
Help is very much appreciated!
logs folderwhich is insideapplicationfolder (not talking about file), if you are sure it is 777 , check your config and make sure about $config['log_path'] = ''; ('' = default) and log_threshold = 4