The Remote Files Browser is an ExpressionEngine 2 add-on that provides a Rackspace Cloud Files, FTP and Amazon S3 filebrowser for your ExpressionEngine publish pages.
Designed to be flexible, you can show all 3 file browsers at the same time through a tabbed interface, or only show one at a time. You can even give each custom field its own server settings, allowing you to connect to multiple Cloud Files, FTP or Amazon S3 accounts.
Use it as many times in a single publish as you need, since the built in Caching ensures that your costs are kept low since requests to Rackspace Cloud Files and Amazon S3 are kept to a minimum.
Worried about users browsing to files they shouldn't? The Remote File Browser lets you restrict browsing to a specific Cloud Files container, FTP folder or S3 bucket. This means your users wont be browsing your entire Content Delivery Network, or FTP server.
When it comes to your templates, you just use the field name like normal without having to worry about whether the user selected a file Cloud Files, FTP or Amazon S3.
Purchase
The Remote File Browser can be purchased and downloaded from Devot-ee.com
Requirements
- ExpressionEngine 2.1 +
- PHP 5+ with JSON and cURL modules
Browser Compatibility
- Firefox 3.5+
- Safari 3+
- Chrome 4+
- Opera 10+
- Internet Explorer 8+
Installation
- Copy the
system/expressionengine/third_party/remote_file_browserfolder to yourexpressionengine/third_party/folder. - Copy the
themes/third_party/remote_file_browserfolder to yourthemes/third_party/folder. If the third_party folder does not exist, create it. - Go to Add-ons → Fieldtypes in the ExpressionEngine control panel and install the fieldtype labelled Remote Files Browser
- You will be prompted to install a module as well as the fieldtype, this module is needed for secure AJAX communication, select 'install' to both the module and the fieldtype
- To setup global settings, go to Add-ons → Fieldtypes → Remote Files Browser and enter the details for the Remote File protocol you wish to use. You may leave file protocols you do not wish to use blank
Cloud Files Settings
The Username is the same username you use to access the Rackspace Cloud control panel. The API key can be found in the Rackspace Cloud control panel by going to Your Account → API Access. The API Key is 32 characters in length and when copying it into the API Key field, make sure you include no spaces.
The Restrict to container field is optional. Entering the name of one of your Cloud Files containers in here will allow you to restrict the user on the publish page to that container.
FTP Settings
The FTP host should be the web address of the FTP server you wish to contact, without "http://". An Address such as ftp.mysite.com is valid whereas http://ftp.mysite.com is not.
The FTP username and password are the same credentials you use to access your site via your desktop FTP program.
The FTP Path is the server path to your public folder on your server with a trailing slash. This is unique to every server environment but some valid examples are: "htdocs/", "www/" or "www.mysite.com/web/content/".
The FTP Server URL is the full public web address to the same folder you specified in the FTP Path setting with a trailing slash. So this could be "http://www.mysite.com/" or if you specified a subfolder in the FTP Path setting, "http://www.mysite.com/subfolder/"
Amazon S3 Settings
The S3 Username is sometimes referred to as the "Access Key", but this along with the S3 Secret Key, can be found in your Amazon AWS control panel
The Restrict to bucket field is optional. Entering the name of one of your S3 buckets in here will allow you to restrict the user on the publish page to that bucket.
- Create a custom channel field as usual, and select Remote Files Browser as the Field type. You may override you global settings in the Custom Field Options section when creating a new field. This will allow you to connect to different servers for each of your fields and channels
How to use
Publish Page
The file viewer
The Remote Files Framework will display a tabbed file browser in your publish page, with each tab representing a different connection protocol. You can navigate the folder structure of your remote server connection by simply clicking the files or folders in the file viewer.
Depending on the nature of your Remote Files Browser package you purchased, you may be able to allow / disallow certain file protocols in the Custom Channel Fields settings when creating a new Remote Files Browser field. This will change the number of tabs shown on the publish page for that field.
You may switch between different connection protocols whilst browsing and the framework will remember your last position.
When selecting a file, the name will be highlighted in blue to confirm you have selected a file. You may preview this file whilst it is highlighted by double clicking the filename or clicking the Preview button
Caching
The Remote Files Framework has a built caching layer that intercepts AJAX requests to save on bandwidth costs when connecting to services such as S3 and Cloud Files.
All file data shown in the file viewer is cached by default and this cache can be dumped by click the Refresh button. When the cache is dumped, only the cache for the current protocol you are viewing is dumped, however, the cache dump erases the entire cached file tree for that protocol.
The Refresh button will also have the Remote Files Framework fetch the file data for the protocol you are viewing again
There are no automatic cache refreshes (eg: after a specified amount of time)
Templates
The field type supports single tags only. Use the field name you specified in your Custom Channel Field settings, to return the full web url to the file you selected in the file viewer on the publish page.
The field also supports a parameter called "show" which allows you to specify what data you want to show in your templates
Simple Example
Lets say you have defined a custom field with a field label of Remote File and field name remote_file and through the publish form selected a file called "my_picture.jpg" using the file viewer.
You can produce the full web url to the selected file by simply calling the field name tag on its own:
Returns:
Your selected file url is http://www.example.com/path/to/image/my_picture.jpg
Parameter Example
Using the file you have selected in the above example, we can retrieve different file attributes by using the show parameter:
Returns:
Your selected filename is my_picture.jpg
Parameters
show
{field_name show="filename"}
Allows you to specify what file attribute to return. This parameter is optional, and if not used, the tag will return the full web url by default.
Accepts the following variables:
- filename - Filename including extension
- path - Server path to the file
- public_url - Full web url to the file
- method - The short name for the file protocol used (eg: ftp, cloud_files, s3)
Troubleshooting
Using a masked Control Panel or non standard system folder location
If you have renamed your control panel file to something different than index.php or you are masking your control panel URL in some other way, you will need to ensure you specify the $config['cp_url'] in your control panel index file.
Example
Lets say you have moved your entire system/ folder above your web root. You have copied the file that was located at system/index.php, renamed it admin.php and placed it at your web root (This would allow you to access the Control Panel via www.example.com/admin.php)
In order for the Remote Files Browser to work, you will need to ensure you specify the new name of the control panel file as a config variable. To do this, you open up the new admin.php in a code editor and CUSTOM CONFIG VALUES section, add the new cp_url setting:
/* * -------------------------------------------------------------------- * CUSTOM CONFIG VALUES * -------------------------------------------------------------------- * * 'cp_url' is typically the only config override variable * that would need to be managed in the control panel index.php file * * Un-comment the $assign_to_config array below to use this feature * */ $assign_to_config['cp_url'] = 'admin.php'; // masked CP access only
You can learn more about masking your control panel for extra security by reading the ExpressionEngine documentation.
Member groups with limited Control Panel Access
If you have members that are not Superadmins using the Remote Files Browser, you will need to allow access to the "Add-ons: Modules" area and allow access to the "Remote_file_browser" in the Module Access Privileges for their Member Group.
These can be found set by clicking on Members->Member Groups->[Your Member Group]->Edit Group. You can find out more about member group preferences in the ExpressionEngine documentation.
Change log
1.6
- Members from groups with limited Control Panel access can now use the fieldtype by configuring the "Module Access Priveledges" & "Control Panel Access" in the Member Group configuration options
1.5.3
- Fixed MySQL installation bug for users of MySQL version 5.0.3 or below
1.5.2
- Fixed a bug whereby remote methods could be loaded more than once, causing conflicts
1.5.1
- Fixed URL issues for when using a masked CP or renamed system folder
1.5
- Public release
1.4
- Beta release

