# Upload images
## How FB Works:
1. The image is send to the backend for upload:
1.1. on the backend the image is resized (biggest side is resized up to 2048px)
1.2. the image is stored in a CDN
1.3. link to the image is return in the response.
2. The UI shows the image from the CDN with option to crop/zoom.
3. Clicking the save button sends to the backend request to store the 'Profile picture'. The request contains the URL to the image and metadata how the image is cropped.
3.1. The backend creates new image with different sizes to be used for different use cases.
3.2 images are stored in CDN and DB.
Using this approach allows to have single point for file uploading and multiple methods for saving the image to different part of the platform.
They use REST for the uploading and GraphQL for setting the profile picture.