Reputation: 2546
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?
Upvotes: 8
Views: 29006
Reputation: 997
Please use APPPATH you will get the directory path of your site root directory.
like this APPPATH.'uploads/images/';
Upvotes: 1
Reputation: 511
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";
Upvotes: 1