![]() |
how to change the "Upload" default error messages - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how to change the "Upload" default error messages (/showthread.php?tid=36822) |
how to change the "Upload" default error messages - El Forum - 12-15-2010 [eluser]himalking[/eluser] hi, can I change or get every error message when upload using the Upload class so, what I want to do exactly is rather than display Quote:"The file you are attempting to upload is larger than the permitted size" I want to display the allowed size Quote:allowed size 2MB and for example istade of Quote:The filetype is not allowed I want Quote:allowed types (PNG | JPG | GIF) thanx in advance how to change the "Upload" default error messages - El Forum - 03-17-2011 [eluser]Mantish[/eluser] Hi hilmaking, I have the same question. Were you able to solve it? Thank you how to change the "Upload" default error messages - El Forum - 03-18-2011 [eluser]BrokenLegGuy[/eluser] How to use the upload class: http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html How to use the form validation class (how to create custom error messages): http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html Everything you want to know is on a combination of those two pages. Ed how to change the "Upload" default error messages - El Forum - 03-18-2011 [eluser]Mantish[/eluser] Thanks BrokenLegGuy I cannot see how to combine these two libraries. Form validation library let me change the messages for each rule. However, the file uploading library uses another rules for validation. These are the ones that I'd like to change the error message. how to change the "Upload" default error messages - El Forum - 03-18-2011 [eluser]BrokenLegGuy[/eluser] [quote author="Mantish" date="1300484567"]Thanks BrokenLegGuy I cannot see how to combine these two libraries. Form validation library let me change the messages for each rule. However, the file uploading library uses another rules for validation. These are the ones that I'd like to change the error message.[/quote] Okay, then I think what you're looking for is this file system/language/[your language]/upload_lang.php and the error messages are there. Let me know. Ed how to change the "Upload" default error messages - El Forum - 03-18-2011 [eluser]Mantish[/eluser] [quote author="BrokenLegGuy" date="1300486504"][quote author="Mantish" date="1300484567"]Thanks BrokenLegGuy I cannot see how to combine these two libraries. Form validation library let me change the messages for each rule. However, the file uploading library uses another rules for validation. These are the ones that I'd like to change the error message.[/quote] Okay, then I think what you're looking for is this file system/language/[your language]/upload_lang.php and the error messages are there. Let me know. Ed[/quote] Thanks a lot Ed!!! It worked like a charm. I just needed to check this http://ellislab.com/codeigniter/user-guide/libraries/language.html I copied upload_lang.php from system to application, and edited the file there. how to change the "Upload" default error messages - El Forum - 03-18-2011 [eluser]BrokenLegGuy[/eluser] I haven't made it to that section of my "study the documentation" quest. Well I should say I haven't needed to go over that section yet but I think I'm going to look over the language class tonight. You learn something new everyday. Ed |