Important notes about image and video upload

Node.js gives us a complete API for handling files (Stream API) such as image, video, pdf, and other formats. There are also several ways to do file uploads to the server or for storage in the cloud, as already noted. Furthermore, the Node.js ecosystem provides us with many modules to deal with the different types of files and to use forms with enctype = "multipart / form-data".

In this chapter, we use the Multer module. Multer is a complete middleware for handling files with various methods for upload and file storage.

In this example, we only stored the filename in MongoDB and sent the file directly to a server folder. There is another way to upload, where we send the file in binary format to the database, ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.