Simple command-line tool for uploading files to S3 with generated download links.
gem install filefling
Configure Filefling using any of these methods (in order of precedence):
- Command line options
- Environment variables
- Config file (~/.filefling.yml)
Set up your AWS credentials using either:
Environment variables:
export AWS_ACCESS_KEY_ID="your_key"
export AWS_SECRET_ACCESS_KEY="your_secret"
export AWS_REGION="us-east-1"
Or AWS credentials file (~/.aws/credentials)
Config file (~/.filefling.yml):
bucket: your-bucket-name
region: us-east-1
expires: 24
prefix: uploads/
Environment variables:
FILEFLING_BUCKET=your-bucket-name
FILEFLING_REGION=us-east-1
FILEFLING_EXPIRES=24
FILEFLING_PREFIX=uploads/
Basic upload:
filefling upload path/to/file.txt
With options:
filefling upload path/to/file.txt --bucket custom-bucket --expires 48 --prefix temp/
--bucket BUCKET S3 bucket name --expires HOURS Link expiration time in hours (default: 24) --prefix PREFIX Add prefix to uploaded filename --region REGION AWS region
Uploaded successfully!
Download link (expires in 24h): https://bucket.s3.amazonaws.com/random-filename.txt
- Ruby >= 3.0.0
- AWS credentials with S3 access
- S3 bucket with appropriate permissions
After checking out the repo:
- Run
bin/setup
to install dependencies - Run
rake test
to run tests - Run
bin/console
for interactive prompt
Bug reports and pull requests welcome on GitHub at https://github.com/durableprogramming/filefling
MIT License - see LICENSE.txt