When using the upload module to upload a banner a absolute path to the image file is created. Is it possible to make this path relative to avoid problems moving from a testing server to a live server? If the banner is re-saved on the live server the path is updated, but this needs to be done for each banner.

Comments

sun’s picture

Title: Path to uploaded banner » Absolute paths to uploaded banners

Please ensure that you have cleaned your site cache. Upload module stores file information in files.filepath in your database. If you see absolute paths there you have to edit file settings in your site configuration (in /admin/settings) to use a relative file path for uploaded files (defaults to files).

Please also remember that Banner module does not work with private file access yet. See corresponding issue.

smsearcy’s picture

Version: master » 4.7.x-1.x-dev

I'm experiencing this same issue with uploaded images for banners. The files.filepath is correctly a relative path, but the in banner.cache the src attribute of the image tag specifies an absolute path to the image, including the domain name. The problem is that I'm editing my site on our internal network, but it's going to be accessed via a different name/IP from the outside world, so it would be useful if the image source did not include the name of the server.

mrf’s picture

So it is safe to empty the banners cache when moving the site? I was hesitant to clear this, because it seemed to be the only place where the physical location of the image was referenced with-in the database. Additionally will this cache automatically clear if cron.php is run?

mrf’s picture

Status: Active » Closed (fixed)