[SOLVED] Upload bug or something else? - 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: [SOLVED] Upload bug or something else? (/showthread.php?tid=16651) |
[SOLVED] Upload bug or something else? - El Forum - 03-12-2009 [eluser]Armchair Samurai[/eluser] I'm having an odd issue with the upload library - it's adding extra underscores to the filename if it has more than one dot. For example, if I upload a file called foo.bar.jpg, the filename will be rewritten as foo.bar_.jpg. This occurs both on my local as well as live servers. Has anyone else encountered this and has a solution? Just in case I'm missing something totally obvious, here's the code to upload files: Code: function upload() [SOLVED] Upload bug or something else? - El Forum - 03-12-2009 [eluser]TheFuzzy0ne[/eluser] That will only happen then there's a whitespace in the filename. By default, whitespaces are replaced with underscores. Also, did you know you can load the language helper and then just use: Code: lang('lang_key'); [SOLVED] Upload bug or something else? - El Forum - 03-12-2009 [eluser]Armchair Samurai[/eluser] Thanks for the reply, but there is no whitespace in the file names - that would have been a little too obvious. I took a look at the source code for the Upload library and found the culprit -_prep_filename() - and fixed it. Also - I'm aware of the Language helper, but I prefer to use libraries in controllers and helpers in views in general - it's just a personal coding preference. |