SimonCox.com

Version 6.4

relax with a cup of green tea

Shorticals

Uploading images outside of Perch CMS default resource directory

I have been building a site using the fabulous Perch CMS but discovered that the default upload path for images is inside the perch directory which caused my a bit of concern. Most Perch based sites I have looked at have been happy to use this but to be extra safe I like to change the name of the Perch directory which is easy to do in the config.php file.

define(‘PERCH_LOGINPATH’, ‘/admin’);

However any uploaded files go into the resources directory which is actually inside the Perch directory - thus revealing what you have renamed it. That wasn’t really how I wanted it so I contacted the Perch chaps - very helpful - to see if I could set a path for the uploads outside of the Perch directory.

What they suggested was changing two of the line in the Perch config.php file to include the full path to the directory file and the directory from the root of the site:
define(‘PERCH_RESFILEPATH’, PERCH_PATH . DIRECTORY_SEPARATOR . ‘/Volumes/Drobo/www.mysite,com/
development/20120508/assets/img/content
’);

define(‘PERCH_RESPATH’, PERCH_LOGINPATH . ‘/assets/img/content’); 

I set this all up as instructed but was getting errors in the control panel - Perch was appending the perch directory - /admin in my example above - on the beginning of the URL for the upload directory giving a path of /admin/assets/img/content- not what was wanted at all!

So I raised the issue with the Perch team again and they gave me some (apparently) undocumented advice to change the two file path lines in config.php to:
define(‘PERCH_RESFILEPATH’, ‘/Volumes/Drobo/www.mysite,com/
development/20120508/assets/img/content’);

define(‘PERCH_RESPATH’, ‘/assets/img/content’);

and that worked a treat!

by Simon Cox | 11 May 2012 |

You are invited to comment

You are invited to post comments about this article. I will publish any comments that I think actively further the conversation and I reserve the right to filter out any comments. Comments on this site are free for general discussion but not for promoting businesses. If you wish to link to a commercial business you are welcome to do so and there is a charge of £10.00 per link per day, payable in advance, with a minimum of 30 days. Enjoy the discussion.

Shorticles

Uploading images outside of Perch CMS default resource directory

Moving images outside of Perch default folder - how I did it...

Read more about Uploading images outside of Perch CMS default resource directory...


Responsive Web Design break points

RWD Breakpoints are the topic of discussion at the moment - my thoughts.

Read more about Responsive Web Design break points...


CSS first-child and IE

Did you know you can use first-child in IE 8 and below?

Read more about CSS first-child and IE...


Aperture tidy up

Quick post: I spent some of the weekend tidying up my photos in Aperture.

Read more about Aperture tidy up...


ExpressionEngine custom log-in page

Just created my own customised EE login screen.

Read more about ExpressionEngine custom log-in page...


EEUK11 tweets from

EEcms tip - transfering site to a new server

Card handling fee?

EEcms tip - looping urls

End July image roll

Content strategies of pages with no content

ExpressionEngine Assets - changing images

When Google+ gets on ifthisthenthat

Big take away from Insites Tour Brighton

Ethan Marcotte’s Responsive Web Design

Actimel - excellent example of bad marketing practice

8 Faces Magazine

Preventing deep linking

Hyphens, dashes, endashes and emdashes v underscores

Main articles

Swanage Belle

Swanage Belle, A trip on a steam pulled train from London to the coast.

I recently booked a trip on the Swanage Belle, a steam hauled special from London down to Swanage on the Dorset Coast. 

Read more about Swanage Belle...


I never met Steve Jobs

I never met Steve Jobs, My thoughts and reflections on the influence of Steve Jobs on me.

Steve Jobs was many things to many people. To me he was one of a handful of people who have had a profound effect on my life.

Read more about I never met Steve Jobs...


EEUK11 report

EEUK11 report, The first ExpressionEngine conference in the UK

The UK's first ExpressionEngine conference has taken place in Manchester in August 2011. I provide a report on the event itself and the surrounding activities.

Read more about EEUK11 report...


Assets for ExpressionEngine

Assets for ExpressionEngine, Installing Pixel & Tonics new Assets add-on

Assets is a new file management add-on for ExpressionEngine and brings a new way of managing assets in your website. I installed it and built a simple image Gallery.

Read more about Assets for ExpressionEngine...


Vintage tractors

Vintage tractors, at the Shakey Super Pull

On the 11th June we attended the Shakey Super Pull run by the Midlands Tractor Pulling Club at the Shakespeare Country Raceway.

Read more about Vintage tractors...