Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7447479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:36:53+00:00 2026-05-29T12:36:53+00:00

can’t understand why this image resizing not working pls help //updating article function updateArticle(){

  • 0

can’t understand why this image resizing not working pls help

//updating article

function updateArticle(){
$data = array(
    'a_title'           =>$_POST['a_title'],
    'a_description'     =>$_POST['a_description'],
    'a_flash_news'      => $_POST['a_flash_news'],
    'a_content'         =>$_POST['a_content'],
    //'a_views'             => $_POST['a_views'],
    'a_image_caption'   =>$_POST['a_image_caption'],
    'a_audio_caption'   =>$_POST['a_audio_caption'],
    'a_video'           =>$_POST['a_video'],
    'a_video_caption'   =>$_POST['a_video_caption'],
    'a_channel'         =>$_POST['a_channel'],
    'a_grouping'        =>$_POST['a_grouping'],
    'a_status'          =>$_POST['a_status'],
    'a_breaking'        =>$_POST['a_breaking'],
    'a_hot'             =>$_POST['a_hot'],
    'a_category_id'     =>$_POST['a_category_id'],
    'a_featured'        =>$_POST['a_featured'],
    'a_tags'            =>$_POST['a_tags'],
    'a_author'          =>$_POST['a_author'],
    'a_date'            =>$_POST['a_date']
    );


    //UPLOAD IMAGE
    //some $config vars for image
    $config['upload_path'] = './images/articles';
    $config['allowed_types'] = 'gif|jpg|jpeg|png';
    $config['max_size'] = '0';
    $config['remove_spaces'] = true;
    $config['overwrite'] = false;
    $config['max_width'] = '0';
    $config['max_height'] = '0';

    //for image resize
    $config['image_library'] = 'gd2';
    $config['maintain_ratio'] = TRUE;
    $config['width'] = 320;
    $config['height'] = 320;

    $this->load->library('upload', $config);
    $this->load->library('image_lib', $config);
    $this->image_lib->resize();
    //upload main image
    if(!$this->upload->do_upload('a_image')){
        //$e = $this->upload->display_errors();
        //print_r($e);
    }

    $image = $this->upload->data();
    if($image['file_name']){
        $data['a_image'] = "images/articles/". $image['file_name'];
    }


    //UPLOAD THUMBNAIL
    unset($config);

    //now upload thumb
    //some $config vars for thumb
    $config['upload_path'] = './images/articles/thumb';
    $config['allowed_types'] = 'gif|jpg|jpeg|png|wav';
    $config['max_size'] = '0';
    $config['remove_spaces'] = true;
    $config['overwrite'] = false;
    $config['max_width'] = '0';
    $config['max_height'] = '0';    
    $this->upload->initialize($config);

        if(!$this->upload->do_upload('a_thumbnail')){
        //$e = $this->upload->dispaly_errors();
        //print_r($e);exit();   
    }       

    $thumb = $this->upload->data();
        if($thumb['file_name']){
        $data['a_thumbnail'] = "images/articles/thumb/". $thumb['file_name'];
    }


    //UPLOAD AUDIO
    unset($config);

    //now upload thumb
    //some $config vars for thumb
    $config['upload_path'] = './audio';
    $config['allowed_types'] = 'mp3|gif|jpg|jpeg|png|wav';
    $config['max_size'] = '0';
    $config['remove_spaces'] = true;
    $config['overwrite'] = false;
    $config['max_width'] = '0';
    $config['max_height'] = '0';    
    $this->upload->initialize($config);

        if(!$this->upload->do_upload('a_audio')){
        //$e = $this->upload->dispaly_errors();
        //print_r($e);exit();   
    }       

    $thumb = $this->upload->data();
        if($thumb['file_name']){
        $data['a_audio'] = "audio/". $thumb['file_name'];
    }

    //goes at last
    $this->db->where('id',$_POST['id']);
    $this->db->update('articles', $data);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:36:56+00:00Added an answer on May 29, 2026 at 12:36 pm

    what error are you getting?

    have the upload paths 777 permissions?

    I think if you need to rezise the images you need to set 777 permissions on the upload path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody tell me why is this not working. I have created a WCF
Can anybody help me? What should be the datatype for this type -07:00:00 of
Can you guys help me understand a concept real quick, I'm having trouble understanding
Can anyone help me trying to find out why this doesn't work. The brushes
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can I run this in a Windows command prompt like I can run it
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Can't figure out how to do this in a pretty way : I have
Can i get the source code for a WAMP stack installer somewhere? Any help
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.