Local File Storage

Håkan Edling edited this page Jun 26, 2018 · 2 revisions

To be able to upload media-files to Piranha you need to use some kind of file storage. The FileStorage stores uploaded media on disk together with the web application, therefor it does not work well for web farms or clustered environments.

Uploaded media files are stored in ~/wwwroot/uploads/.

Installation

The File Storage can be installed by adding the NuGet package:

Piranha.Local.FileStorage

Registering File Storage

You register File Storage in ConfigureServices() with the following call:

services.AddPiranhaFileStorage();

The File Storage service is by default registered as a Singleton, but if you need to change the behaviour in your application you can provide the ServiceLifetime when registering the component:

services.AddPiranhaFileStorage(ServiceLifetime.Scoped);
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.