By default, Sitecore stores media assets in binary format in the database. We just need to make sure 02 Sitecore settings as-is:
<!– UPLOAD AS FILES
Controls whether Sitecore stores media as files or as database records by default.
This setting is ignored if the Media.DisableFileMedia setting is true.
<setting name=”Media.UploadAsFiles” value=”false” />
<!– MEDIA – DISABLE FILE MEDIA
Enables or disables storage of media as files rather than database records.
If true, user interfaces do not present options to store media as files.
All files will be stored in the database, disregarding the value of the Media.UploadAsFiles setting.
Default value: false
<setting name=”Media.DisableFileMedia” value=”false” />
However, it is NOT working as expected. Users will upload media as files rather than database records if they check Upload as files checkbox whilst they’re using “Upload files (advanced)” option which is shown below:
Per my search, I suppose that there is one more step to make Sitecore store media as database records completely: hide Upload as files checkbox.
SOLUTION: set value of Upload.UserSelectableDestination Sitecore setting to false
<!– UPLOAD USER SELECTABLE DESTINATION
Defines if the user can select the destination database or file.
<setting name=”Upload.UserSelectableDestination” value=”false” />
Then Upload as files checkbox is gone
- Upload a file to the Media Library
- Storing Sitecore Media in the Database vs. the File System
- How to Remove Upload as Files Checkbox