What if you could extend that allowed MIME types list with PDF? You would still have control of the secure environment and open the door only for PDF files. PowerShell to the rescue! As I mentioned earlier, it’s a web application setting and with PowerShell you can access this list by calling the property AllowedInlineDownloadedMimeTypes.To see what’s allowed out of the box execute this little script:

$webapp = Get-SPWebApplication 
$webapp.AllowedInlineDownloadedMimeTypes

The result looks like this showing just a part of it::application/fractalsapplication/internet-property-streamapplication/liquidmotionapplication/mac-binhex40application/ms-infopath.xmlapplication/msaccessapplication/mswordapplication/odaapplication/oleobjectapplication/onenote:

All we have to do is add our PDF MIME type to this list:

$webapp = Get-SPWebApplication $webapp.AllowedInlineDownloadedMimeTypes.Add“application/pdf”
$webapp.Update

There you go again. You’re even the IT department’s hero of the day!

via

PDF files can not be opened directly, only saved » SharePoint : Working on it….

Annunci