Created
September 19, 2016 18:00
-
-
Save rdegges/9e253a271eaed6c02aaf307f1ce058a6 to your computer and use it in GitHub Desktop.
express-stormpath-s3 file upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/', stormpath.loginRequired, (req, res, next) => { | |
req.user.uploadFile('./some-file.txt', err => { | |
if (err) return next(err); | |
req.user.getCustomData((err, data) => { | |
if (err) return next(err); | |
res.send('file uploaded as ' + data.s3['package.json'].href); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment