[eluser]meer[/eluser]
Code:
function do_upload()
{
config['upload_path'] = './your_dolder_path/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$field_name = 'image';// image field name of your view
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload($field_name))
{
echo"error";
return FALSE;
}
else
{
$image_data = $this->upload->data();
$filename = $image_data['file_name'];
$config = array
(
'source_image' => $image_data['full_path'],
'new_image' => './uploads/thumbs/',
'maintain_ratio' => ftrue,
'width' => 75,
'height' => 50
);
$this->load->library('image_lib', $config);
$this->image_lib->resize();
.....