Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Transfer.sh | 14,038 | 2 | 13 days ago | 24 | May 15, 2022 | 36 | mit | Go | ||
Easy and fast file sharing from the command-line. | ||||||||||
Shrine | 3,072 | 255 | 45 | 4 days ago | 53 | June 14, 2021 | 9 | mit | Ruby | |
File Attachment toolkit for Ruby applications | ||||||||||
Evaporatejs | 1,762 | 26 | 12 | 4 months ago | 51 | October 08, 2017 | 91 | JavaScript | ||
Javascript library for browser to S3 multipart resumable uploads | ||||||||||
S3 Uploads | 1,756 | 43 | 9 | 2 days ago | 19 | July 30, 2021 | 178 | PHP | ||
The WordPress Plugin to Store Uploads on Amazon S3 | ||||||||||
S4cmd | 1,249 | 7 | 5 months ago | 5 | August 13, 2018 | 107 | apache-2.0 | Python | ||
Super S3 command line tool | ||||||||||
React S3 Uploader | 776 | 118 | 34 | 2 years ago | 59 | November 04, 2020 | 52 | mit | JavaScript | |
React component that renders an <input type="file"/> and automatically uploads to an S3 bucket | ||||||||||
S3_direct_upload | 648 | 5 years ago | 114 | mit | Ruby | |||||
Direct Upload to Amazon S3 With CORS | ||||||||||
Django S3direct | 602 | 76 | 1 | a year ago | 78 | June 17, 2022 | 33 | mit | Python | |
Directly upload files to S3 compatible services with Django. | ||||||||||
S3 Plugin Webpack | 477 | 125 | 59 | a year ago | 37 | November 04, 2020 | 15 | mit | JavaScript | |
Uploads files to s3 after complete | ||||||||||
Gulp Awspublish | 398 | 1,530 | 199 | 5 months ago | 57 | March 04, 2022 | 21 | mit | JavaScript | |
gulp plugin to publish files to amazon s3 |
React Native AWS3 is a module for uploading files to S3. Unlike other libraries out there, there are no native dependencies.
npm install --save react-native-aws3
The user associated with the accessKey
and secretKey
you use must have the appropriate permissions assigned to them. My user's IAM policy looks like:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1458840156000",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl"
],
"Resource": [
"arn:aws:s3:::my-bucket/uploads/*"
]
}
]
}
import { RNS3 } from 'react-native-aws3';
const file = {
// `uri` can also be a file system path (i.e. file://)
uri: "assets-library://asset/asset.PNG?id=655DBE66-8008-459C-9358-914E1FB532DD&ext=PNG",
name: "image.png",
type: "image/png"
}
const options = {
keyPrefix: "uploads/",
bucket: "your-bucket",
region: "us-east-1",
accessKey: "your-access-key",
secretKey: "your-secret-key",
successActionStatus: 201
}
RNS3.put(file, options).then(response => {
if (response.status !== 201)
throw new Error("Failed to upload image to S3");
console.log(response.body);
/**
* {
* postResponse: {
* bucket: "your-bucket",
* etag : "9f620878e06d28774406017480a59fd4",
* key: "uploads/image.png",
* location: "https://your-bucket.s3.amazonaws.com/uploads%2Fimage.png"
* }
* }
*/
});
Upload a file to S3.
Arguments:
file
uri
required - File system URI, can be assets library path or file://
pathname
required - The name of the file, will be stored as such in S3type
required - The mime type, also used for Content-Type
parameter in the S3 post policyoptions
acl
- The Access Control List of this object. Defaults to public-read
keyPrefix
- Prefix, or path to the file on S3, i.e. uploads/
(note the trailing slash)bucket
required - Your S3 bucketregion
required - The region of your S3 bucketaccessKey
required - Your S3 AWSAccessKeyId
secretKey
required - Your S3 AWSSecretKey
successActionStatus
- HTTP response status if successful, defaults to 201awsUrl
- AWS S3 url. Defaults to s3.amazonaws.com
timeDelta
- Devices time offset from world clock in milliseconds, defaults to 0Returns an object that wraps an XMLHttpRequest
instance and behaves like a promise, with the following additional methods:
progress
- accepts a callback which will be called with an event representing the progress of the upload. Event object is of shape
loaded
- amount uploadedtotal
- total amount to uploadpercent
- number between 0 and 1 representing the percent completedabort
- aborts the xhr instanceExamples:
RNS3.put(file, options)
.progress((e) => console.log(e.loaded / e.total)); // or console.log(e.percent)
RNS3.put(file, option)
.abort();
DeleteObject
and (authenticated) GetObject
operations.