Uploading images to Cloudinary
While FastAPI is perfectly capable of serving static files – through the StaticFiles
module (https://fastapi.tiangolo.com/tutorial/static-files/) – you will rarely want to use your server space and bandwidth to store images or videos.
Many specialized services can take care of digital asset media management and, in this section, you will learn how to work with one of the premier players in the area—Cloudinary.
Cloudinary, as its name suggests, is a cloud-based service that provides various solutions for digital media assets and web and mobile applications. These services include uploading and storing images and videos, and these are precisely the functions that we are going to use now.
However, Cloudinary and other similar specialized services offer much more (image and video manipulations, filters, automatic cropping and formatting, and real-time transformations) and they might be an excellent fit for many media workflows...