upload-photos-s3

0.2.0 • Public • Published

upload-photos-s3

Build Status

CLI utility for uploading photos from your desktop to an S3 bucket. You can specify the bucket, prefix, and an album name. All file names will be used directly.

npm install upload-photos-s3 -g

CLI Usage

upload-photos-s3 /Volumes/camera/photos/ --album "my vacation in thailand"

All album names will be prefixed with a date and will not include special characters or spaces (replaced with underscores). The example above will look like:

11-19-2017-my_vacation_in_thailand/photo1.jpeg
11-19-2017-my_vacation_in_thailand/photo2.jpeg
11-19-2017-my_vacation_in_thailand/photo3.jpeg

Set up the following environment variables in your bash_profile:

export UPLOAD_PHOTOS_AWS_ACCESS_KEY="1234"
export UPLOAD_PHOTOS_AWS_SECRET="abcd"
export UPLOAD_PHOTOS_S3_BUCKET="example-bucket"
export UPLOAD_PHOTOS_S3_PREFIX="custom/photos/path"

Javascript Usage

const uploader = require('upload-photos-s3');
 
const options = {
  albumName: 'something neat',
  accessKeyId: 'aws key',
  secretAccessKey: 'aws secret',
  s3bucket: 'bucket-name',
  s3prefix: 'custom/path/to/photos' // no slash at the end
};
 
uploader('/path/to/photos', options, function(err) {
  // onward
});

Test

npm test

Readme

Keywords

none

Package Sidebar

Install

npm i upload-photos-s3

Weekly Downloads

1

Version

0.2.0

License

ISC

Last publish

Collaborators

  • mapsam