Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Root path of site in CodeIgniter

I am using Uploading Class to upload images. But the location where my uploaded images will be stored is: http://www.mysite.com/uploads/

Absolute path to this folder is: c:\wamp\www\mysite\uploads\

Application folder is in : c:\wamp\www\mysite\application\

So when I upload to server, absolute path will not be same. So, how to get absolute root path to use with the upload_path config of Uploading Class?

like image 372
Vpp Man Avatar asked Jun 17 '13 18:06

Vpp Man


2 Answers

This is coming late but the right path is:

FCPATH.'uploads';
like image 61
JobSam Avatar answered Nov 16 '22 02:11

JobSam


If the uploads folder is in the root of your site then you can simply use ./uploads in your upload path configuration.

$config['upload_path'] = "./uploads";
like image 42
Amin.Che Avatar answered Nov 16 '22 02:11

Amin.Che