Version 6.5

relax with a cup of green tea

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/

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/

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

and that worked a treat!

by | 11 May 2012 |

comments powered by Disqus


Caulking a website article

I wrote a little something for 12 devs -day 7

Read more about Caulking a website article...

Thoughts on IE browser upgrades

Quick post about IE browser upgrades.

Read more about Thoughts on IE browser upgrades...

Password security

Read more about Password security...

England Argentina

Read more about England Argentina...

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

CSS first-child and IE

Aperture tidy up

EE 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

Using a CDN to help migrate your sites hosting

Using a CDN to help migrate your sites hosting, without having that DNS propagation wait

Moving a site to new hosting can be fraught with issues. Here is one technique that I find useful when moving to a website to a new hosting server.

Read more about Using a CDN to help migrate your sites hosting...

Halle Marchandise en bois

Halle Marchandise en bois, French meter gauge goods shed

A plaster model kit of a classic French wooden goods shed.

Read more about Halle Marchandise en bois...

Small Run Batch Deutz OO9 kit - part 2

Small Run Batch Deutz OO9 kit - part 2, Body work for the SRB001 Freelance DEUTZ Style 0-4-0DM

Completion of the SRB001 Freelance DEUTZ Style 0-4-0DM chassis including the running gear and motor withthe body work following.

Read more about Small Run Batch Deutz OO9 kit - part 2...

Small Run Batch Deutz OO9 kit

Small Run Batch Deutz OO9 kit, SRB001 Freelance DEUTZ Style 0-4-0DM

Stuart Brewer is a fellow GDNGRS member and is one of the most acomplished model makers I know - this is his first kit and my attempts at building it.

Read more about Small Run Batch Deutz OO9 kit...

Whitesands Quay first outing

Whitesands Quay first outing, Work in progress gets out the house

Whitesands Quay first outing gets it out of the house and sets some deadlines for me to work to.

Read more about Whitesands Quay first outing...