Globally Update Image Storage Location
14 posts by 6 authors in: Forums > CMS Builder
Last Post: March 25, 2011 (RSS)
By johnnybegood - March 18, 2010 - edited: March 18, 2010
I purchased CMS Builder some months ago and deployed a website with little fuss. I liked this software so much that I just purchased 2 more copies.
The only frustrating issue I had with this software is that during development I was using a development server with a different root directory structure to the live server. This was fine except that when it came time to set the website "live" I had to manually go through and update all the previously uploaded images as their location was hard coded in the database.
I don't understand why the entire root location (ie. var/www/vhosts...etc) is required when storing images in the cms_uploads table. There is already a setting in admin where the Upload Directory is specified so couldn't this just be prepended to the image name? If the image name was the only thing stored then this would also enable transfer of a website to a websites sub-folder with minimal fuss. Currently this is a very laborious process; which I also discovered when I moved the development website from a "beta" folder to the domains root directory.
I am aware that it's possible to "recreate" thumbnails but this is not relevant to this particular issue.
Is there something I'm missing here or something I'm doing wrong?
Re: [johnnybegood] Globally Update Image Storage Location
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
Re: [johnnybegood] Globally Update Image Storage Location
By Donna - March 18, 2010
Hmm, that's a bit odd, you definitely shouldn't have to update the database itself -- try northernpenguin's suggestion of updating the settings.dat.php file and let us know if that works for you?
--
support@interactivetools.com
Re: [northernpenguin] Globally Update Image Storage Location
By johnnybegood - March 24, 2010 - edited: March 24, 2010
This means I still have to manually go into the database and change entries within these 4 columns:
filePath
urlPath
thumbFilePath
thumbUrlPath
I cant see anything in this script that actively goes through and updates this information within the cms_uploads table based on the details present in settings.dat.php
Any help would be greatly appreciated.
Re: [johnnybegood] Globally Update Image Storage Location
By Dave - March 24, 2010
It's a limitation of the current setup that full image paths are stored (instead of relative) and something that is on our todo list to address.
You can move data from one server to another the images will still display, but deleting them won't remove the file since the filepaths won't be accurate.
There's some technical reasons why we haven't gotten to this yet, but for now the quickest workaround for now is as follows:
- Click "Backup" under: Admin > General
- Download the new .sql backup file from /data/backups
- Create a backup copy of this file.
- Open the original in your favorite text or file editor
- Do a search and replace for "oldpath" to "newpath"
- Upload it and click restore
Basically: Backup -> Edit .sql file -> Restore
That's also a handy way to do other search and replaces if needed.
Hope that helps!
interactivetools.com
Re: [Dave] Globally Update Image Storage Location
By johnnybegood - March 25, 2010 - edited: March 25, 2010
Since you brought up backups I was recently thinking it'd be nice if the client could run the backup script without giving them full administrative rights. I tried creating a custom menu link to the backup script but it errors and I don't want to confuse the client by giving them full access. Is there an easy workaround for this?
Re: [johnnybegood] Globally Update Image Storage Location
By Dave - March 25, 2010
http://www.interactivetools.com/add-ons/detail.php?Auto-Backup-1003
You just set your preferences and enable the plugin and it can automatically create and maintain rolling hourly, daily, weekly, and monthly mysql backups (so you'll always have backups the 3 hours, weeks, etc but minimize diskspace used). It can also automatically email you a zipped backup files.
Hope that helps!
interactivetools.com
Re: [Dave] Globally Update Image Storage Location
By JLynne77 - March 24, 2011
I was wondering if this would be how to globally update file upload allowances.
For instance, I want to grant the ability to upload PDF files to content fields in multiple sections. Right now, I have to go through each section and add 'pdf' to the allowed files list individually.
Would I have to use this work around to do this across the board or is there already a global setting to do this that I might be missing?
~Jessica Sullivan, Crystal Realm Designs.
Re: [Duches77] Globally Update Image Storage Location
By Jason - March 24, 2011
Which version of CMS Builder are you using?
In the newer versions, the upload field defaults to allowing the following extensions:
gif,jpg,png,wmv,mov,swf,pdf
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Globally Update Image Storage Location
By JLynne77 - March 24, 2011 - edited: March 24, 2011
~Jessica Sullivan, Crystal Realm Designs.