Git Product home page Git Product logo

node-aws-s3-fileupload's Introduction

Node Express AWS S3 File Upload

A simple file uploader using multer and aws-sdk

Routes

POST /upload

  • Handles a file upload form
  • Example html:
<html>
  <body>
    <form ref='uploadForm' 
      id='uploadForm' 
      action='http://localhost:7000/upload' 
      method='post' 
      encType="multipart/form-data">
        <input type="file" name="inputFile" multiple />
        <input type='submit' value='Upload!' />
    </form>     
  </body>
</html>

Create .env file and provide values for the following:

AWS_S3_BUCKET = 
AWS_ACCESS_KEY_ID = 
AWS_SECRET_ACCESS_KEY = 
AWS_DEFAULT_REGION = 

References

AWS S3 Official Docs

Multer S3

AWS S3 Bucket with NodeJS

node-aws-s3-fileupload's People

Contributors

gurenax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-aws-s3-fileupload's Issues

Error: Access point ARN region is empty

This is a great simple example.

I get this error when I use my bucket name (it's full public).

InvalidAccessPointARN: Access point ARN region is empty
    at Request.validateAccessPointArn (/home/carpanta/Documentos/Cosas/Curro/nodejs/tutoriales/AWS-S3-fileupload-express/node_modules/aws-sdk/lib/services/s3.js:202:28)

AWS_S3_BUCKET = arn:aws:s3:::web-public-assets
AWS_DEFAULT_REGION = eu-west-1

However, if I use a Access Point to my bucket, it works perfectly.

AWS_S3_BUCKET = arn:aws:s3:eu-west-1:653025358451:accesspoint/web-public-assets

Did you use a name bucket like arn:aws:s3:::name-bucket to make it work?

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.