Skip to content

Instantly share code, notes, and snippets.

@bjornbjorn
Created September 28, 2012 18:41
Show Gist options
  • Save bjornbjorn/3801466 to your computer and use it in GitHub Desktop.
Save bjornbjorn/3801466 to your computer and use it in GitHub Desktop.
@focuslabllc Master Config file upload directory paths
$env_config['upload_preferences'] = array(
1 => array(
'name' => 'Uploads',
'server_path' => APPPATH."..\\..\\webroot\\uploads\\",
'url' => $env_config['base_url'].'uploads/'
),
);
@Natetronn
Copy link

$env_config['upload_preferences'] = array(
1 => array(
'name' => 'Default Uploads',
'server_path' => $images_path . '/uploads/',
'url' => $images_url . '/uploads/'
),
2 => array(
'name' => 'Second Folder',
'server_path' => $images_path . '/another_one/',
'url' => $images_url . '/another_one/'
),
2 => array(
'name' => 'Third Folder',
'server_path' => $images_path . '/third_one/',
'url' => $images_url . '/third_one/'
)
);

You also need to create the actual folder itself in the location you set. If you add a third item don't forget to add a trailing comma to the end of the second item. The numbers ie. 1,2,3 should coincide with the ID of the file upload preferences in the CP so, theoretically they could be 3, 4 and 5 or anything for that matter as they are dependent on the ID as mentioned. I recommend adding a trailing slash / to the end of the server_path, something which wasn't done in the example of the master config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment