![]() |
Upload Path - 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 Path (/showthread.php?tid=37555) |
Upload Path - El Forum - 01-13-2011 [eluser]Gerep[/eluser] Hi guys...after reading the guide I couldn't find the solution for my problem I'm trying to upload a image but the path is invalid and I don't know why $config['upload_path'] = '../uploads/images'; My folder structure is: -controller -uploads -images -docs Based on the file type I change the upload_path but its not working, the only way is by changing the upload_path to something like: c:\xampp\my_system\system\application\uploads\images I'm working locally. What am I doing wrong? Thanks in advance. Upload Path - El Forum - 01-13-2011 [eluser]Cristian Gilè[/eluser] If uploads folder is at the same level of controller the right setting is: Code: $config[‘upload_path’] = ‘./system/application/uploads/images/’; or, like this, if application folder is outside the system folder Code: $config[‘upload_path’] = ‘./application/uploads/images/’; Remember that you upload folder must be writable. Hint: put your upload folder outside the webroot and set an absolute path for $config[‘upload_path’] Cristian Gilè Upload Path - El Forum - 01-13-2011 [eluser]mi6crazyheart[/eluser] From u'r folder structure, it seems(if i'm right) all are in one level(inside "application" folder) which is i think not right place to keep such folders. For such, folders(uploads/images/docs) make an "assets" folder in the root of u'r CI installation. A better folder structure is like this... -application -assets ---uploads -system -user_guide Then make u'r config path like this: Code: $config['upload_path'] = './assets/uploads/'; Upload Path - El Forum - 01-13-2011 [eluser]Gerep[/eluser] Thanks Cristian Gilè it worked ![]() mi6crazyheart I'll take your advice in consideration, thanks too. |