Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community

What's New in Craft CMS 4

Asset Volumes and Filesystems

Craft 4 introduces the concept of Filesystems and this is how they work alongside Asset Volumes.

In Craft 4, we now have the con­cept of Filesys­tems. While it is a new con­cept, it’s just a break away from the Vol­umes func­tion­al­i­ty we know well from Craft 3.

In Craft 3, we have just one con­cept for stor­ing and retriev­ing cus­tom uploaded files: Assets Vol­umes. These vol­umes have the fol­low­ing attributes:

  • Name
  • Han­dle
  • Whether the vol­ume has pub­lic URLs
  • Base URL (if public)
  • Vol­ume Type
  • File sys­tem path
  • Field Lay­out

This set­up com­bines both the stor­age loca­tion (some direc­to­ry on disk or in a remote vol­ume, like Ama­zon S3) and specifics about the assets being stored (fields, etc).

In Craft 4, the con­cept of Assets Vol­umes in bro­ken up into two pieces, with filesys­tems hold­ing the infor­ma­tion about the actu­al stor­age location. 

Filesys­tems have the fol­low­ing properties:

  • Name
  • Han­dle
  • Whether filesys­tem has pub­lic URLs
  • The filesys­tem type (local fold­er, AWS S3 etc)
  • Base path

Asset Vol­umes now have the fol­low­ing properties:

  • Name
  • Han­dle
  • Asset Filesys­tem (linked via filesys­tems in the data­base or envri­on­ment variable)
  • Trans­form Filesystem
  • Trans­form Subpath
  • Field Lay­out

Asset Vol­umes are cre­at­ed sep­a­rate­ly and then linked to a filesys­tem. You can only have one filesys­tem link in an assets vol­ume. If you want to con­trol the filesys­tems by envi­rone­ment, then you should use envi­ron­ment variables.

What's New in Craft CMS 4 is made up of the following videos: