Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

Uploading a profile photo

Allowing a user to upload a profile photo will require that we store the uploaded image file and retrieve it on request to load it in the view. There are multiple ways of implementing this upload feature while considering the different file storage options:

  • Server filesystem: Upload and save files to a server filesystem and store the URL in MongoDB.
  • External file storage: Save files to external storage such as Amazon S3 and store the URL in MongoDB.
  • Store as data in MongoDB: Save files that are small in size (less than 16 MB) to MongoDB as data of the Buffer type.

For MERN Social, we will assume that the photo files that are uploaded by the user will be small in size and demonstrate how to store these files in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content