We’ve had the ability to upload document templates to content types in SharePoint since SharePoint 2007. It’s been the way organizations that want to manage the forms used by employees would publish them. However, recent changes in Office 365 have broken this capability by default. There are a few workarounds to the problem – but none of them are particularly desirable.
Changes and Scripts
For some time, Office 365 has treated uploading a document template to a content type as “custom script.” In the tenant admin settings page, there’s a section for custom scripts:
We’ve had to tell customers to set this to “Allow” because of the impact it has on blocking document templates. However, a more recent change requires an action for every site collection that’s created.
There’s a new site collection level flag called DenyAddAndCustomizePages. When it’s set, you can’t upload custom documents to content types. If you’re still using the classic SharePoint administration, this flag isn’t set, and you’re fine. However, if you are using the new SharePoint administration, site collections you create get this flag set. To resolve it, you must connect to your tenant and then do a set-sposite <url> -DenyAddAndCustomizePages 0. This releases the flag and allows you to upload the document template. This works as long as you are a tenant administrator or you can get the administrator to run the command for you – but for many people, this will prevent them from being able to do the best practice for managing document templates.
In addition to manually resetting the flag to zero, there are two workarounds. First, use the Content Type Hub (/sites/contenttypehub), which is still created without this flag. This works if you have access to this site collection. You can create and then publish the content type, which will get it into every site. That’s fine if you want to publish a content type to every site – but that may not be ideal for everyone.
The second approach is to fall back to SharePoint classic administration, because it doesn’t set this flag.
If you want Microsoft to fix this, can I suggest that you up vote the suggestion at https://office365.uservoice.com/forums/264636-general/suggestions/33296125-cannot-upload-content-template-with-scripting-disa.
No comment yet, add your voice below!