Мне нужно загрузить изображение в папку uploads. Код для загрузки указан ниже
$profile_image = 'profile_image';
$this->load->library('custom_upload_lib');
//get file extension
$fileExtension = "";
if($_FILES["profile_image"]["name"]):
// "profile_image" is the form input field name
$path_info = pathinfo($_FILES["profile_image"]["name"]);
$fileExtension = $path_info['extension'];
endif;
$upload_path = './uploads/profile_image/';
$allowed_types = 'GIF|gif|PNG|png|jpg|JPEG|jpeg';
$max_size = 2048;
$encrypt = false;
$saved_file_name = "profile_".rand(2,8)
.strtotime(date('Y-m-d H:i:s')).'.'.$fileExtension;
//$saved_file_name=$_FILES["profile_image"]["name"];
$overwrite = false;
$upload_control_name = $profile_image ;
$filePath = "";
$uploadname = "";
if($fileExtension != "")
{
$upload_data = $this->custom_upload_lib->configure_upload($upload_path,
$allowed_types,$max_size,$encrypt,$saved_file_name,
$overwrite,$upload_control_name);
if(is_array($upload_data))
{
$filePath = $upload_data['full_path'];
$uploadname = 'profile_image/'.$upload_data['file_name'];
$temp_upload_name = $upload_data['file_name'];
$width = 90;
$height = 90;
$this->load->library('resize_lib');
$resize = $this->resize_lib->_resizeImage(
$filePath ,$temp_upload_name, $width, $height);
if(!$resize)
{
$message = $resize;
$this->session->set_flashdata('message', $message );
redirect(site_url('admin/preacher'));
}
}
else
{
$message = $upload_data;
$this->session->set_flashdata('message', $message );
redirect(site_url('admin/preacher'));
}
}
Мне нужно изменить размер изображения до 90 X 90. Но изменение размера не работает ..