1

I'm having an issue with my upload directories. I converted an existing site to use the FocusLab config set up and everything is working fine. However I've just noticed that in the CP thumbnails are missing from all entries and on the front end new images are not being displayed.

I ftp'd into the server and in my directories I can see the images but they've all been renamed so that they are directorynamefilenam.jpg

i.e. house.jpg inside directory general is now named generalhouse.jpg.

Not sure why this is happening or how to fix it.

The relevant code from config.master.php is below

/**
 * Custom upload directory paths
 * 
 * The array keys must match the ID from exp_upload_prefs
 */
 $env_config['upload_preferences'] = array(
     1 => array(
         'name'        => 'Home Page Slideshow',
         'server_path' => $images_path . '/home_slideshow',
         'url'         => $images_url  . '/home_slideshow/'
     ),
     2 => array(
         'name'        => 'Portfolio Logos',
         'server_path' => $images_path . '/portfolio',
         'url'         => $images_url  . '/portfolio/'
     ),
     3 => array(
         'name'        => 'Team Photos',
         'server_path' => $images_path . '/team',
         'url'         => $images_url  . '/team/'
     ),
     4 => array(
         'name'        => 'News Images',
         'server_path' => $images_path . '/news',
         'url'         => $images_url  . '/news/'
     ),
     4 => array(
         'name'        => 'General',
         'server_path' => $images_path . '/general',
         'url'         => $images_url  . '/general/'
     )
 );

If I synchronize a directory I get the following errors:

generalColor_Block_Icon_with_i.jpg: invalid_filename

generalPetArmor-Dog.png: invalid_filename

This is error is on all images on all directories.

  • Double check that $images_path and $images_url are correct (I usually use $base_path and $base_url instead) Also, add a slash to the end of $images_path/s e.g 'server_path' => $images_path . '/home_slideshow/', – Natetronn Apr 22 '14 at 18:51
  • Nate - I did what you said and it worked, but I think that Stephen's answer below would cover it. Anyhow all good now. Thanks. – CreateSean Apr 22 '14 at 19:00
5

Add the trailing slash for the 'server_path' also.

/**
 * Custom upload directory paths
 * 
 * The array keys must match the ID from exp_upload_prefs
 */
 $env_config['upload_preferences'] = array(
     1 => array(
         'name'        => 'Home Page Slideshow',
         'server_path' => $images_path . '/home_slideshow/',
         'url'         => $images_url  . '/home_slideshow/'
     ),
     2 => array(
         'name'        => 'Portfolio Logos',
         'server_path' => $images_path . '/portfolio/',
         'url'         => $images_url  . '/portfolio/'
     ),
     3 => array(
         'name'        => 'Team Photos',
         'server_path' => $images_path . '/team/',
         'url'         => $images_url  . '/team/'
     ),
     4 => array(
         'name'        => 'News Images',
         'server_path' => $images_path . '/news/',
         'url'         => $images_url  . '/news/'
     ),
     4 => array(
         'name'        => 'General',
         'server_path' => $images_path . '/general/',
         'url'         => $images_url  . '/general/'
     )
| improve this answer | |
0

I just had this same problem. I was able to fix it by updating the EE install from 2.3.1 (I think) to 2.8.1.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.