Welcome Guest, Not a member yet? Register   Sign In
Upload Path

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:

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.

[eluser]Cristian Gilè[/eluser]
If uploads folder is at the same level of controller the right setting is:

$config[‘upload_path’] = ‘./system/application/uploads/images/’;

or, like this, if application folder is outside the system folder

$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è

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...

Then make u'r config path like this:
$config['upload_path'] = './assets/uploads/';

Thanks Cristian Gilè it worked Wink

mi6crazyheart I'll take your advice in consideration, thanks too.

Theme © iAndrew 2016 - Forum software by © MyBB