Fog.io - Ruby

Learn how to configure Fog.io for use with Filebase.

What is Fog.io?

Fog.io is a cloud services library for Ruby. Fog.io allows you to seamlessly integrate your cloud configuration into your Ruby application.

Read below to learn how to use Fog.io with Filebase.

Prerequisites:

1. Install Fog.io:

gem install fog

2. Download and install the fog-aws package:

gem install fog-aws

3. Create the file ~/.fog with the following content:

default:
	aws_access_key_id:     <YOUR_FILEBASE_ACCESS_KEY>
	aws_secret_access_key: <YOUR_FILEBASE_SECRET_ACCESS_KEY>

4. In your Ruby application, add fog-aws as a dependency:

require 'fog/aws'

5. Connect to the Filebase S3 service:

Using Fog-AWS

Creating a file:

Listing files:

Generating a Pre-signed URL for a file:

Copying a File to a Bucket

Using Multipart Upload

To speed transfers of large files, the concurrency option can be used to spawn multiple threads. Note that the file must be at least 5 MB for multipart uploads to work. For example:

Last updated

Was this helpful?