Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions 16/umbraco-cms/extending/filesystemproviders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@

The MediaPath Scheme defines the current set of rules that decide the format of the Media Path when it is saved into the media archive wherever it is located.

By default the MediaPath scheme used by Umbraco is the `UniqueMediaPathScheme` this generates a unique 'folder' to place the uploaded image in eg.
By default the MediaPath scheme used by Umbraco is the `UniqueMediaPathScheme` this generates a 'folder' to place the uploaded image in, for example:

`/media/dozdrg2f/mylovelyimage.jpg`

`/media` is defined by the PhysicalFileSystem and 'dozdrg2f' is generated by the `UniqueMediaPathScheme`.
`/media` is defined by the PhysicalFileSystem and `dozdrg2f` is generated by the `UniqueMediaPathScheme`.

{% hint style="info" %}

Check warning on line 149 in 16/umbraco-cms/extending/filesystemproviders/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words). Raw Output: {"message": "[UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words).", "location": {"path": "16/umbraco-cms/extending/filesystemproviders/README.md", "range": {"start": {"line": 149, "column": 4}}}, "severity": "WARNING"}
The folder generated by `UniqueMediaPathScheme` is not strictly unique, as it's based on the first eight characters of the GUID for the media item. In practice, with randomly generated GUIDs, a collision is unlikely.

There is an increased possibility of generating colliding paths if creating media programmatically and setting keys using version 7 "ordered" GUIDs via `Guid.CreateVersion7()`. As such these should be avoided. `UniqueMediaPathScheme` will throw an exception if it detects they have been used. Any manually created keys should use `Guid.NewGuid()`.
{% endhint %}

You can create your own logic for the path by implementing `IMediaPathScheme` and setting it during composition with:

Expand Down
Loading