Skip to content

Instantly share code, notes, and snippets.

View eventhough's full-sized avatar

Kevin Wu eventhough

View GitHub Profile
@eventhough
eventhough / Uploader.jsx
Last active January 14, 2019 12:25
React component for handling S3 file upload
var React = require('react');
var Dropzone = require('react-dropzone');
var axios = require('axios');
exports = module.exports = React.createClass({
_onDrop: function (files) {
var file = files[0];
axios.get(ENDPOINT_TO_GET_SIGNED_URL, {
filename: file.name,
@eventhough
eventhough / AWSUtil.js
Last active August 29, 2015 14:24
Method to generate signed URL for AWS S3
var aws = require('aws-sdk');
aws.config.update({
accessKeyId: AWS_ACCESS_KEY
secretAccessKey: AWS_SECRET_KEY
});
exports = module.exports = {
sign: function(filename, filetype) {
var s3 = new aws.S3();