Change uploads url

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
xcheffo
New Member
New Member
Posts: 2
Joined: Wed Jun 11, 2008 8:21 am

Change uploads url

Post by xcheffo »

I would like to have my uploaded files stored into a separate directory, but I would like to have them mapped on the document root.

For example, I want to have

Code: Select all

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/some/where/cmsms-root/uploads';
#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/';

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = '/var/www/cmsms-new/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/images';
so that I still access my images on
http://www.example.com/cmsms-root/images/logo1.gif
instead on
http://www.example.com/cmsms-root/images/[b]uploads[/b]/logo1.gif

My config is

Code: Select all

CMSMS 1.2.5
Server version: Apache/2.2.3
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
PHP 5.2.0-8+etch11 (cli) (built: May 10 2008 10:46:24)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Change uploads url

Post by Dr.CSS »

Well you can mess with it, but best practices is to have them in, for images used in templates, uploads/templatename folder or some such and for images used in pages, editor inserted images, uploads/images even uploads/images/anotherfolder this is so they can see them when picking images...

The way you are trying is some thing that is most times how static HTML/CSS sites are set up, like I did for years...

The root image folder is for images used in the admin interface...
xcheffo
New Member
New Member
Posts: 2
Joined: Wed Jun 11, 2008 8:21 am

Re: Change uploads url

Post by xcheffo »

Thank you, mark. The point about the separating template images from the content images was really good.

My goal, though, is different:
I simply want to strip the uploads part from the image url. I still prefer to have the uploadables in separate directory (on my server file system), as you suggest, and if this directory is the deafult - that is the best.

Moreover, I believed this is perfectly achievable with proper configuration in config.php, but it does not worked for me.
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am

Re: Change uploads url

Post by Wiedmann »

Code: Select all

$config['image_uploads_path'] = '/var/www/cmsms-new/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/images';
For this configuration you must move the files in the directory:
"/var/www/cmsms-new/images/cms/"
to:
"/var/www/cmsms-new/uploads/images/cms/"

and then remove the directory:
"/var/www/cmsms-new/images/"
Post Reply

Return to “CMSMS Core”