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

  • SEARCH
  • Home
  • 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 8108649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:10:48+00:00 2026-06-06T01:10:48+00:00

I am using CodeIgniter to upload some files through a form. I know how

  • 0

I am using CodeIgniter to upload some files through a form. I know how to translate “regular” form errors (required, valid_email, etc) but I don’t know how to do it with file errors (file is not allowed, file is too big, etc).

Which keys should I use in

$this->form_validation->set_message('KEY', 'TRANSLATION');

?

Thanks

  • 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-06-06T01:10:49+00:00Added an answer on June 6, 2026 at 1:10 am

    METHOD 1

    By default, language files are typically stored in system/language directory. Alternately you can create a file called upload_lang.php inside your application/language folder and store them there.

    $lang['upload_userfile_not_set']        = "Unable to find a post variable called userfile.";
    $lang['upload_file_exceeds_limit']      = "The uploaded file exceeds the maximum allowed size in your PHP configuration file.";
    $lang['upload_file_exceeds_form_limit'] = "The uploaded file exceeds the maximum size allowed by the submission form.";
    $lang['upload_file_partial']            = "The file was only partially uploaded.";
    $lang['upload_no_temp_directory']       = "The temporary folder is missing.";
    $lang['upload_unable_to_write_file']    = "The file could not be written to disk.";
    $lang['upload_stopped_by_extension']    = "The file upload was stopped by extension.";
    $lang['upload_no_file_selected']        = "You did not select a file to upload.";
    $lang['upload_invalid_filetype']        = "The filetype you are attempting to upload is not allowed.";
    $lang['upload_invalid_filesize']        = "The file you are attempting to upload is larger than the permitted size.";
    $lang['upload_invalid_dimensions']      = "The image you are attempting to upload exceedes the maximum height or width.";
    $lang['upload_destination_error']       = "A problem was encountered while attempting to move the uploaded file to the final destination.";
    $lang['upload_no_filepath']             = "The upload path does not appear to be valid.";
    $lang['upload_no_file_types']           = "You have not specified any allowed file types.";
    $lang['upload_bad_filename']            = "The file name you submitted already exists on the server.";
    $lang['upload_not_writable']            = "The upload destination folder does not appear to be writable.";
    

    METHOD 2

    You can use Flashdata after upload process.

    if ($this->upload->do_upload())
    {
        $this->session->set_flashdata('success', 'Yep! Upload complete');
        redirect('go_back_home');
    }
    else
    {
        $this->session->set_flashdata('error', 'Uh, upload not complete! The problem is..'); // Manually check
        redirect('go_back_form');
    }
    

    You can also check the problem with $this->upload->data(). This is a helper function that returns an array containing all of the data related to the file you uploaded. Here is the array prototype :

    Array
    (
        [file_name]    => mypic.jpg
        [file_type]    => image/jpeg
        [file_path]    => /path/to/your/upload/
        [full_path]    => /path/to/your/upload/jpg.jpg
        [raw_name]     => mypic
        [orig_name]    => mypic.jpg
        [client_name]  => mypic.jpg
        [file_ext]     => .jpg
        [file_size]    => 22.2
        [is_image]     => 1
        [image_width]  => 800
        [image_height] => 600
        [image_type]   => jpeg
        [image_size_str] => width="800" height="200"
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using codeigniter, but what I've done is made a small upload form. When
I am using Codeigniter and I am trying to upload multiple files into a
I am using codeigniter and Jquery. I have an upload form in my view
I'm using the following CodeIgniter function to upload files which works fine: function uploadFiles(){
Firstly, I'm not asking how to perform a multi-file upload using CodeIgniter, but rather
I tried to upload a vcard file using codeigniter. But It's not allowed to
I am doing a multiple upload using the Multiple_upload library in codeigniter, and form
So I'm using Codeigniter and I want to upload files. It's working fine except
I'm creating an upload form using CodeIgniter and I'd like to upload a plaintext
I am using Uploadify to upload Files and using Codeigniter framework. Here is my

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.