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

[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.
#2

[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è
#3

[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/';
#4

[eluser]Gerep[/eluser]
Thanks Cristian Gilè it worked Wink

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




Theme © iAndrew 2016 - Forum software by © MyBB