1

In my form have 3 file upload input option.

bot are going to different directory. I can work with one directory but not work with multiple.

My code

        $config['upload_path'] = './uploads/video';
        $config['allowed_types'] = 'flv|mov|m4v|mp4';
        $config['max_size'] = '30720';
        $config['encrypt_name'] = TRUE;

        $this->load->library('upload', $config);
        $this->upload->do_upload('userfile');
        $video_upload=$this->upload->data();

        $config2['upload_path'] = './uploads/video';
        $config2['allowed_types'] = 'jpg|jpeg|bmp|png';
        $config2['max_size'] = '30720';
        $config2['encrypt_name'] = TRUE;

        $this->load->library('upload', $config2);
        $this->upload->do_upload('thumbnail1');
        $thumbnail_upload=$this->upload->data(); 

here video file upload successfully but image file not upload

1 Answer 1

3

$this->load->library() doesn't reload or reinitialize the library if it's already loaded.

In this case, you need to modify the existing loaded library options:

$this->upload->initialize($config2);

instead of

$this->load->library('upload', $config2);

Should do the trick.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.