Create New Post

CodeIgniter MCQs with answer part - 6

  1. Which method is used to initialize file upload in CodeIgniter?

    • A) initialize()
    • B) start_upload()
    • C) upload()
    • D) setup_upload()

    Answer: A) initialize()

  2. How do you load the File Upload library in a CodeIgniter controller?

    • A) $this->load->library('file_upload')
    • B) $this->file_upload->load()
    • C) $this->file_upload->library('file_upload')
    • D) $this->library('file_upload')

    Answer: A) $this->load->library('file_upload')

  3. Which method is used to perform file upload in CodeIgniter?

    • A) upload()
    • B) do_upload()
    • C) start_upload()
    • D) process_upload()

    Answer: B) do_upload()

  4. How do you specify upload settings such as allowed file types and maximum file size in CodeIgniter?

    • A) By calling the set_upload_config() method
    • B) By setting configuration options in the config.php file
    • C) By passing an array of settings to the initialize() method
    • D) Upload settings cannot be configured in CodeIgniter

    Answer: C) By passing an array of settings to the initialize() method

  5. Which of the following is NOT a valid method to access uploaded file data in CodeIgniter?

    • A) $this->upload->data()
    • B) $this->upload->get_data()
    • C) $this->upload->info()
    • D) $this->upload->file_info()

    Answer: B) $this->upload->get_data()

  6. What is the purpose of CodeIgniter's Image Manipulation class?

    • A) To manage database connections
    • B) To handle form submissions
    • C) To manipulate images (resize, crop, rotate, etc.)
    • D) To generate HTML forms

    Answer: C) To manipulate images (resize, crop, rotate, etc.)

  7. Which method is used to load an image file into the Image Manipulation class in CodeIgniter?

    • A) load_image()
    • B) read_image()
    • C) load()
    • D) image()

    Answer: C) load()

  8. How do you resize an image using CodeIgniter's Image Manipulation class?

    • A) By calling the resize() method
    • B) By setting the resize configuration option
    • C) By using the resize_image() function
    • D) Resize functionality is not available in CodeIgniter's Image Manipulation class

    Answer: A) By calling the resize() method

  9. What is the purpose of CodeIgniter's Caching class?

    • A) To manage database connections
    • B) To handle form submissions
    • C) To cache frequently accessed data for improved performance
    • D) To generate HTML forms

    Answer: C) To cache frequently accessed data for improved performance

  10. How do you enable caching for a specific piece of data in CodeIgniter?

    • A) By calling the enable_cache() method
    • B) By setting the cache configuration option
    • C) By passing a cache expiration time to the cache() method
    • D) Cache functionality is enabled by default in CodeIgniter

    Answer: C) By passing a cache expiration time to the cache() method

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

62575