cms

How to make Sitecore store media as database records completely

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.
Default: false
–>
<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:

uploadasfiles

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.
Default: true
–>
<setting name=”Upload.UserSelectableDestination” value=”false” />

Then Upload as files checkbox is gone

uploadasfiles2

REFERENCES

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s