Remote File Browser

Developer

Christopher Imrie

3rd Party (Commercial)


EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

Add-On Type(s)

Fieldtype

Tags

This fieldtype allows you to have a Rackspace Cloud Files, FTP and Amazon S3 file browser inside of your EE publish page. Flexible settings allow you to only show one, two or all three file browsers in a single field as well as customize your settings to have each field connect to different Cloud Files, FTP, or Amazon S3 accounts. The file browser also includes Caching to ensure your keep you Cloud Files and Amazon S3 requests to a minimum.

See it in action

Requirements

     
  • ExpressionEngine 2.1 +
  •  
  • PHP5+ with JSON and cURL modules installed

Browser Compatibility

     
  • Firefox 3.5+
  •  
  • Safari 3+
  •  
  • Chrome 4+
  •  
  • Opera 10+
  •  
  • Internet Explorer 8+

Installation

     
  1. Copy the system/expressionengine/third_party/remote_file_browser folder to your expressionengine/third_party/ folder.
  2.  
  3. Copy the themes/third_party/remote_file_browser folder to your themes/third_party/ folder.  If the third_party folder does not exist, create it.
  4.  
  5. Go to Add-ons → Fieldtypes in the ExpressionEngine control panel and install the fieldtype labelled Remote Files Browser
  6.  
  7. 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
  8.  
  9. 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
  10.    
  11. 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

Field Specific Settings

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.
 

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:

{exp:channel:entries channel="channel_name"}
    Your selected file url is {remote_file}
{/exp:channel:entries}
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:


{exp:channel:entries channel="channel_name"}
     Your selected filename is {remote_file show="filename"}
{/exp:channel:entries}
    

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 “and “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 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

Remote File Browser Links

This entry was created July 19, 2010, 11:55 am.
This entry was last updated April 9, 2012, 5:01 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.