Pular para o conteúdo principal

Store files on the local file system

This guide explains how to store uploaded files on the file system of the Casdoor server. Casdoor stores them in its files directory. For example, if Casdoor runs in /home/user/casdoor, the files are in /home/user/casdoor/files.


Learning outcomes​

  • Add a local file system storage provider.
  • Choose a path prefix.

What you need​

  • Administrator access to the Casdoor admin console

Add the provider​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Storage and Type to Local File System.

    Local file system provider

  3. Optionally, set Path prefix. Casdoor then stores the files in a subdirectory with that name.

  4. Save the provider.

With a path prefix:

Provider with a path prefix

Files stored under the prefix

Without a path prefix:

Provider without a path prefix

Files stored without a prefix

nota

In a container, mount the files directory on a volume. Otherwise, the files are lost when the container is replaced.

See also​