Code Snippets

Using Stage File Proxy on Drupal

Stage File Proxy is a great module for Drupal to sync databases without syncing the files which can take up a lot of storage space. For more information check out this blog post.

Setting up Stage File Proxy is extremely easy. After the module has been enabled, simply add the following to your settings.php

$conf['stage_file_proxy_origin'] = 'http://example.com'; // no trailing slash

If the site is using HTTP Basic Authentication (the browser popup for username and password) you can embed those in the url. Be sure to URL encode any special characters:

$conf['stage_file_proxy_origin'] = 'http://myusername:letme%26in@example.com';

If you want to hotlink the files rather than downloading them:

$conf['stage_file_proxy_hotlink'] = TRUE;
 

 

Resource Tags: