Welcome Guest, Not a member yet? Register   Sign In
Getting absolute path for uploading a file
#1

[eluser]jaswinder_rana[/eluser]
Hi:

I am trying to upload a file with upload.php CI library. Its giving me wrong upload path error.

My structure is

system
- applicaiton
-- views
public_html
- index.php
- public
-- upload
--- YYYY
---- MMDD

How can I refer to "upload" directory from my controller? My solutions seem to be

- Use absolute path from controller; don't want to make it fix
- Store absolute path in my own config file and include it
- Somehow try to calculate the path automatically

I was hoping that there is a way that I can get my path for index.php (in this case /some/path/public_html). Is there a way in CI to do that?

I don't want to have to change it everytime I change servers with different paths.

Please help


Messages In This Thread
Getting absolute path for uploading a file - by El Forum - 12-17-2008, 04:24 PM
Getting absolute path for uploading a file - by El Forum - 12-18-2008, 02:01 AM
Getting absolute path for uploading a file - by El Forum - 12-18-2008, 02:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB