Closed Natetronn closed 12 years ago
I don't understand the problem. Can't you just write out the path correctly with back slashes?
I was thinking I needed to write the whole path with backslashes though, looks like this will in fact work:
$env_config['upload_preferences'] = array(
1 => array(
'name' => 'Uploads',
'server_path' => $images_path . '\uploads',
'url' => $images_url . '/uploads/'
)
);
which returns:
C:/wamp/www/mysite/public_html/images\uploads
Do you know if the backslash will also work on Unix based file systems? I'm going to test it though, maybe you know from memory.
Thanks
Do you know if the backslash will also work on Unix based file systems? I'm going to test it though, maybe you know from memory.
I'm not sure. I haven't had to deal with *nix/Windows path differences in EE (ever). If you find out something concrete let me know though :)
Erik this is what I came up with and seems to be working though, I'm not sure if this is the best way to approch:
$slash_type = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '\\' : '/';
$env_config['upload_preferences'] = array(
1 => array(
'name' => 'Page Uploads',
'server_path' => $images_path . $slash_type.'uploads'.$slash_type.'page/',
'url' => $images_url . '/uploads/page/'
)
);
When setting up the file uploads path, on windows, it needs backslashes vs forward slashes.
Note this bug report: http://expressionengine.com/bug_tracker/bug/17593
I'm going to try and come up with a solution though, maybe you have an idea already to conditionally check for Unix vs Windows and set the paths accordingly?