Skip to content

Instantly share code, notes, and snippets.

Avatar
🎉

Reece Charsville charsville

🎉
View GitHub Profile
@charsville
charsville / Upload.ts
Created Nov 24, 2022
AWS S3 upload function
View Upload.ts
import { PutObjectOutput, PutObjectRequest } from 'aws-sdk/clients/s3';
import {AWSError} from 'aws-sdk/lib/error';
import * as S3 from 'aws-sdk/clients/s3';
import Connect from './connection';
/**
* Uploads a file to your bucket in either the root or a subdirectory
* In this example we are making all objects publicly accessible by using the ACL 'public-read'. If you want to make
* the file private or use a different access policy then you can read more about canned ACLs here: https://amzn.to/2UoGMdh
*