0

I have a form which has max size limit for attachment when user tries to upload is 10MB ( in my Case). When i try to upload more than that CI redirecting to the form with error message "select a file to upload". But i want error message like this "upload a file which is lesser size than 10MB". How should i over write that error message.

Note: I am using CodeIgniter file upload class entirely..........

5
  • Do echo ini_get('post_max_size'); and echo ini_get('upload_max_filesize');. Maybe your upload size is limited by php. Commented Nov 1, 2012 at 7:40
  • i only limited to 10 MB..........but the error message showing when i tried to upload more than that size is unrelated to context....that error message is "You did not select a file to upload" Commented Nov 1, 2012 at 7:44
  • I think if the uploaded file size exceeds that set by php (note: not in codeigniter), the file will be ignored by php. So Codeigniter might be finding no file to upload and throwing the error. Commented Nov 1, 2012 at 7:47
  • If you changed the error message, try submitting the form without uploading any file. Commented Nov 1, 2012 at 7:48
  • i didn't change error message..............i think it's ignoring file thats y it's giving that error........... Commented Nov 1, 2012 at 8:02

1 Answer 1

3

In system/language directory, there is file named upload_lang.php. You can modify error messages from there.

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

3 Comments

yeah it's correct but the problem is if i try to upload file with more size why it's giving error "You did not select a file to upload"........thats for another error
its a bad idea to change directly in upload_lang.php as this error message will be shown whenever this condition matches any where in the project in any form.
If I have more than 1 file upload field in different forms then the above solution will not work.

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.