Uploading images to your server-side filesystem is actually not a great idea. If you are deploying from your repo, you don't want to mix in user-generated media with your code. A much better and more scalable approach is to put your photos and other media in a completely separate static location, such as Amazon S3, where you can access them without letting them interfere with your core application.
In this recipe, we will upload images to Amazon S3 and display them after they are uploaded.
For this recipe, we will use the Amazon SDK for Node. It can be installed by running
npm install aws-sdk –save in your terminal. We will also use lodash (
npm install lodash --save) and the
q promise library (
npm install ...