Welcome Guest, Not a member yet? Register   Sign In
Specifying a source_image in do_upload
#3

[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();  
                .....


Messages In This Thread
Specifying a source_image in do_upload - by El Forum - 06-01-2012, 12:22 PM
Specifying a source_image in do_upload - by El Forum - 06-05-2012, 04:45 AM
Specifying a source_image in do_upload - by El Forum - 06-05-2012, 05:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB