Giter Site home page Giter Site logo

uppy-aws-amplify's Introduction

uppy-aws-amplify

The AWS Amplify Storage (S3) plugin for uppy which can be used to upload files directly to an S3 bucket using an AWS Amplify session.

This package uses Storage from the aws-amplify package under the hood, which will use the default configuration you're using for AWS Amplify in your app.

Example

import Uppy from '@uppy/core'
import AwsAmplify from 'uppy-aws-amplify'
import { Storage } from 'aws-amplify'

const uppy = Uppy()

uppy.use(AwsAmplify, {
  // configured AWS Amplify Storage reference
  // with `get` and `put` methods
  storage: Storage,
  // default options passed to `Storage.get(...)`
  getOptions: {
    download: false
  },
  limit: 4,
  async getUploadParameters (file) {
    return {
      // Example: to avoid filename conflicts
      filename: `${Date.now()}-${file.name}`
    }
  }
})

Installation

$ npm install uppy-aws-amplify --save

or

$ yarn add uppy-aws-amplify

We recommend installing from yarn and then using a module bundler such as Webpack, Browserify or Rollup.js.

uppy-aws-amplify's People

Contributors

joelvh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

polem

uppy-aws-amplify's Issues

this class reference out of scope

Thanks for the great plugin btw.

I was getting an error resulting from "this" being undefined inside the storage.put call within handleFileUpload method.

if (!this.uppy.getFile(file.id)) {

I thought that maybe the reference to the parent class 'this' was out of scope hence undefined. As a test I stored a reference to the parent class in var parentClass = this; index the handleFileUpload method. The used that in place of this to reference the parent class. It appears to remove the error.

Not sure if this is helpful, just wanted to share it

Cheers!

typescript support

Currently using uppy and amplify, stumbled upon this but there's no support for typescript. Would be a nice feature to include.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.