Skip to content

Instantly share code, notes, and snippets.

@schempy
schempy / stream-file-upload-s3-nodejs.js
Last active July 21, 2022 01:10
Streaming File Uploads To Amazon S3 With Node.js
View stream-file-upload-s3-nodejs.js
var http = require('http');
var router = require('routes')();
var Busboy = require('busboy');
var AWS = require('aws-sdk');
var inspect = require('util').inspect;
var port = 5000;
// Define s3-upload-stream with S3 credentials.
var s3Stream = require('s3-upload-stream')(new AWS.S3({
accessKeyId: '',
@schempy
schempy / stream-file-uploads-nodejs.js
Created March 11, 2015 21:59
Streaming File Uploads With Node.Js
View stream-file-uploads-nodejs.js
var http = require('http');
var router = require('routes')();
var Busboy = require('busboy');
var port = 5000;
// Define our route for uploading files
router.addRoute('/images', function (req, res, params) {
if (req.method === 'POST') {
// Create an Busyboy instance passing the HTTP Request headers.