Monday 10 April 2017

SharePoint: Browser File Handling Deep Dive

#URL for Browser file handling DEEP DIVE :  https://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-browser-file-handling-deep-dive.aspx
#URL for MIME Types : http://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc
#URL for HTML :https://sharepointobservations.wordpress.com/2014/05/15/sharepoint-2013-enable-browser-handling-for-specific-file-types/

#General Settings has to be strict

#HTML

#ADD

$webApplication = Get-SPWebApplication "URL"
$webApplication.AllowedInlineDownloadedMimeTypes.Add("text/html")
$webApplication.Update()

#REMOVE

$webApplication = Get-SPWebApplication "URL"
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("text/html")
$webApplication.Update()

#EXCEL/PDF/WORD

#REMOVE WILL GIVE OPTION FOR SAVE AND CANCEL IN IE

$webApplication = Get-SPWebApplication "URL"
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.openxmlformats-officedocument.wordprocessingml.document") 
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/msword")
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.ms-word.document.12") 
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") 
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.ms-excel")
$webApplication.Update()

#ADD WILL GIVE OPTION FOR OPEN AND CANCEL IN IE

$webApplication = Get-SPWebApplication "URL"
$webApplication.AllowedInlineDownloadedMimeTypes.Add("application/vnd.openxmlformats-officedocument.wordprocessingml.document") 
$webApplication.AllowedInlineDownloadedMimeTypes.Add("application/msword")
$webApplication.AllowedInlineDownloadedMimeTypes.Add("application/vnd.ms-word.document.12") 
$webApplication.AllowedInlineDownloadedMimeTypes.Add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") 
$webApplication.AllowedInlineDownloadedMimeTypes.Add("application/vnd.ms-excel")
$webApplication.Update()

No comments:

Post a Comment