We are closing this chapter after covering a lot of different topics that have to do with working with files in Drupal 8.
We started with a couple of introductory sections in which we introduced some general concepts such as the various file systems (storages) that Drupal 8 uses, as well the how stream wrappers come into play for working with them. We also introduced the different ways to work with files--managed vs unmanaged.
Next, we dove into working with managed files and created an image field on our Product entity type so that we could import images into it. The other example of working with managed files had us create a new Product importer based on a CSV file of data and we also saw how to upload, read and process such a file, as well as manually track its usage. As a parenthesis, we introduced a very powerful feature of Drupal 8 that allows us to hook into the entity CRUD operations and perform actions whenever these are fired. This is a majorly important technique module developers typically use in Drupal.
We then switched gears and implemented our own stream wrapper to serve our imaginary remote API that stored the product images. Moreover, we talked about working with unmanaged files and some of the functions we can use for this--things similar to managed files except the function names are different and there are no File entities or usage tracking to them.
We continued with the private file system and a talk about what this serves and how we can work with it to control access to our own files. As opposed to allowing users to bypass Drupal and download files from the public file system.
Finally, we finished the chapter with a look at the APIs surrounding images and how we can use toolkits to process images, both manually and as part of image styles. And even more useful, we saw how we can render images in all sorts of ways in Drupal 8 and get our hands on image style URLs.
In the next and final chapter, we will look at automated testing and how we can ensure that our code works and that we don't introduce regressions along the way.