Welcome Guest, Not a member yet? Register   Sign In
Upload Path invalid on upload
#3

(This post was last modified: 02-23-2020, 09:21 AM by dave friend.)

I suggest building the upload path like this

PHP Code:
$config['upload_path'] = FCPATH 'assets/images/'

FCPATH is the path to the folder where CI's index.php is found.

An alternate way to build the path is this.

PHP Code:
$config['upload_path'] = str_replace('application''assets/images'APPPATH); 

I don't think either one is clearly superior, but the first is the simplest. That's good, right?

jrekland's answer works too, but be aware that it won't include a trailing slash because realpath() removes trailing delimiters. I cannot remember if a trailing slash is important in this use-case or not.
Reply


Messages In This Thread
Upload Path invalid on upload - by murugappan - 02-22-2020, 10:04 PM
RE: Upload Path invalid on upload - by jreklund - 02-23-2020, 02:39 AM
RE: Upload Path invalid on upload - by dave friend - 02-23-2020, 09:19 AM
RE: Upload Path invalid on upload - by murugappan - 02-23-2020, 09:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB