
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@uppy/aws-s3
Advanced tools
@uppy/aws-s3 is a plugin for Uppy, a file uploader for web browsers, that allows users to upload files directly to an AWS S3 bucket. It handles the necessary steps to securely upload files to S3, including generating signed URLs and managing the upload process.
Direct Upload to S3
This feature allows users to upload files directly to an AWS S3 bucket using Uppy. The code sample demonstrates how to set up Uppy with the AwsS3 plugin, specifying a companion URL for handling the S3 upload process.
const Uppy = require('@uppy/core');
const AwsS3 = require('@uppy/aws-s3');
const uppy = Uppy();
uppy.use(AwsS3, {
companionUrl: 'https://companion.uppy.io/'
});
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
});
Customizing Upload Parameters
This feature allows customization of upload parameters by providing a function to fetch parameters from a server. The code sample shows how to configure the AwsS3 plugin to use a custom endpoint to retrieve upload parameters for each file.
const Uppy = require('@uppy/core');
const AwsS3 = require('@uppy/aws-s3');
const uppy = Uppy();
uppy.use(AwsS3, {
companionUrl: 'https://companion.uppy.io/',
getUploadParameters(file) {
return fetch('/s3/params', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({ filename: file.name, contentType: file.type })
}).then((response) => {
return response.json()
})
}
});
The aws-sdk package is the official AWS SDK for JavaScript, which provides a comprehensive set of tools for interacting with AWS services, including S3. Unlike @uppy/aws-s3, which is specifically designed for file uploads in the browser, aws-sdk is a general-purpose library that can be used for a wide range of AWS operations, including managing S3 buckets and objects.
s3-upload-stream is a Node.js package that provides a streaming interface for uploading files to S3. It is more low-level compared to @uppy/aws-s3 and is typically used in server-side applications to handle large file uploads efficiently. While @uppy/aws-s3 is focused on browser-based uploads, s3-upload-stream is designed for server environments.
react-s3-uploader is a React component for uploading files to S3. It provides a simple interface for integrating S3 uploads into React applications. Compared to @uppy/aws-s3, which is part of the Uppy ecosystem and can be used with various frameworks, react-s3-uploader is specifically tailored for React applications.
The AwsS3 plugin can be used to upload files directly to an S3 bucket. Uploads can be signed using Companion or a custom signing function.
Uppy is being developed by the folks at Transloadit, a versatile file encoding service.
import Uppy from '@uppy/core'
import AwsS3 from '@uppy/aws-s3'
const uppy = new Uppy()
uppy.use(AwsS3, {
limit: 2,
timeout: ms('1 minute'),
companionUrl: 'https://companion.myapp.com/',
})
$ npm install @uppy/aws-s3
Alternatively, you can also use this plugin in a pre-built bundle from
Transloadit’s CDN: Smart CDN. In that case Uppy
will attach itself to the
global window.Uppy
object. See the
main Uppy documentation for instructions.
Documentation for this plugin can be found on the Uppy website.
FAQs
Upload to Amazon S3 with Uppy
The npm package @uppy/aws-s3 receives a total of 179,027 weekly downloads. As such, @uppy/aws-s3 popularity was classified as popular.
We found that @uppy/aws-s3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.