![]() |
upload filename with multiple dots 2.0.3 problem - 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: upload filename with multiple dots 2.0.3 problem (/showthread.php?tid=45544) |
upload filename with multiple dots 2.0.3 problem - El Forum - 09-26-2011 [eluser]rogierb[/eluser] Hello all, I'm rewriting a 10 year old system and are now faced with fun filenames like this.is.a.old.filename.jpg which is causing problem in the upload library. After each part an underscore is added even if you add the 'overwrite' config. This is due to the nature of _prep_filename() in the Uploads library. Since nowadays common practice is to use either underscores or dashes, the possibility of dots is forgotten. I would like to use dashes or underscores but I'm not going to rename thousands of files, so i had to change a core method wich I hate. My quick and very dirty solution is Code: foreach ($parts as $part) Am I missing something? Can this be solved without hacking the core? upload filename with multiple dots 2.0.3 problem - El Forum - 05-16-2012 [eluser]Colm Ward[/eluser] Old thread I know, but you can get around this simply by setting Code: 'allowed_types' => '*' I didnt want to allow any kind of file to be uploaded. So I solved this by extending the core, which is slightly less hacky than changing the core directly: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |