0
votes

I'm using Codeigniter 2.2 , i have created admin Panel . this is my file structure localhost base_url is localhos/project/3/

url for my admin panel controllers were stored in

base_url/admin-(application/controllers/admin)

and my user controllers were stored in

base_url/ - (application/controllers/)

i have article options in admin panel and configured CKEDITOR file upload. file upload directory is

application/uploads

everthing works fine till here.i got problems in setting image url for the uploaded images.

if i set the URL as "../application/uploads/filename", works on admin panel but not in User View.

if i use this "application/uploads/filename" it doesn't work in admin panel but work in User View. I have a other choice by setting the by base_url()/uploads/filename . If i use this i want to change each and every image tag in database if i change any folder. It will be a big Mess.

1
did you try by using application path APPPATH ?Ashok Maharjan
@AshokMaharjan yeah i tried but APPPATH will return applicationCrazy Developer

1 Answers

0
votes

It very simple just call file path like this

$file_path = APPPATH.'uploads/filename.jpg';