bitcababy / file_browser

Web-based File Manager with Rich Text editor integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DESCRIPTION

A rails plugin that provides a basic file browser. The primary use case for this plugin is:

  • To manage a directory of files includes subdirectories

  • To integration with products like CKEditor for selecting files.

Guiding Principals:

  • No database required

  • Pluggable backends (filesystem, S3, etc.) - Filesystem only currently

  • Pluggable integration with 3rd party products such as CKEditor

Possible Future Features:

  • Launcher can specify only certain file types to show (images only, only certain extensions, etc.)

  • Allow basic image manipulation (resize, crop, etc.)

  • File upload progress monitoring (for large files)

  • Icon previews (mainly for images show thumbnail for icon)

SETUP

In your Gemfile add:

gem 'file_browser'

In an initializer add:

FileBrowser.storages[:local] =
  FilesystemStorage.new Rails.root.join('public/uploaded_files')

Change the above path to be wherever you want to write files. Also make sure that directory is writable by the application.

Copy the assets to your public directory. This will likely later be automated as Rails adds support.

Finally point your browser to /local/uploaded_files/index and start managing your files via the web.

See example_integrations directory for how to integrate with 3rd party tools such as CKEditor.

CONFIGURATION

By default the app will use the “file_browser” layout. Obviously your can override that in your application if you want. If you want it to use the same layout as your main layout simply symlink file_browser.html.erb to your application.html.erb file. If you use your own layout make sure that it includes the prototype library and that it yields to the symbol :file_browser_footer.

You can have multiple storage repositories that can be registered and accessed. See FileBrowser#storages for more info.

CREDIT

This gem was developed by Eric Anderson (pixelwareinc.com) while developing projects under Red Tusk Studios (redtusk.com).

About

Web-based File Manager with Rich Text editor integration