How to stop editors from uploading media directly to the server file system

Sitecore has the ability to allow users to upload media files directly to the server instead of the database. When SQL admins want to keep the DB's tidy by keeping the files out of SQL, this is a good option. But when you do, the Ops team is in charge of moving those files between servers.

How to stop editors from uploading media directly to the server file system

TL;DR

Add this setting to all your projects so editors can't upload media directly to your servers. Unless you want them to.

<setting name="Upload.UserSelectableDestination" value="false"/>

FULL READ

Let's start off with the issue. Sitecore has the ability to allow users to upload media files directly to the server instead of the database. When SQL admins want to keep the DB's tidy by keeping the files out of SQL, this is a good option. But when you do, the Ops team is in charge of moving those files from the CM server the file was uploaded to, to all of the other CM servers and the CD servers.

The setting to turn on Sitecore uploading files directly to the server disk is done via this setting. (By default, it is set to False). You can find a good explanation of this on Mark Ursino's blog.

<setting name="Media.UploadAsFiles" value="true">

All New files will be put on disk. You will know they are on disk because the File Path setting will have a physical path in it now. If you need to convert the media from disk, back to SQL, there is a repo that can get you started. Media conversion tool and the marketplace tool.

File-Path

NOW, I say that server storage is basically free now. So the argument about SQL space isn't much of an argument to me. If you have that many images, you should be using a DAM or a CDN for your images. If you lose a server, and all your images are in the database, it is super easy to get all your media back. So I say, Never allow users to upload files to your server.

BUT WAIT! Sitecore, for some reason, gives the user a choice to upload files to disk, even if you don't want them to. In the bulk upload advanced dialog, they have a check box for upload as files. When checked, they are uploaded to disk and not DB. And if you are not prepared for this, it is going to lead to a lot of missing images and docs on your website.

upload-as-files

Sitecore, being the configuration wizard that it is, has a setting to prevent the user from even having the option.

<setting name="Upload.UserSelectableDestination" value="false"/>

When you set that to false, it removes the 'upload as files' check box. So now no files will accidentally end up on the servers hard drive.

Boom.
maxresdefault