Below are the few methods to Open PDF files,HTM files in browser in Sharepoint 2010 ::
Hope this helps...
Web Application level setting: Method 1 (UI)
• Go to SharePoint 2010 Central Administration > Application Management > Manage Web Applications
• Select the row of your web application
• Click General Settings in the ribbon
• Scroll down to Browser File Handling and select Permissive
• Click Ok
• Select the row of your web application
• Click General Settings in the ribbon
• Scroll down to Browser File Handling and select Permissive
• Click Ok
Web Application level setting: Method 2
1
2
3
|
$webApp.BrowserFileHandling = "permissive" $webApp.update() |
Web Application level setting: Method 3 (recommended)
1
2
3
4
5
6
7
8
9
10
|
If ($webApp. "application/pdf") { Write-Host -ForegroundColor White "Adding Pdf MIME Type..." $webApp. $webApp.Update() Write-Host -ForegroundColor White "Added and saved." } Else { Write-Host -ForegroundColor White "Pdf MIME type is already added." } |
Site Collection level
1
2
3
4
5
6
7
8
9
10
11
12
|
foreach ( $subsite in $site.allwebs ) { foreach ($list in $subsite.Lists) { if($list.browserfilehandling -eq "Strict") { $list.browserfilehandling = "Permissive"; $list.update(); } } } |
Site level ( SPWeb )
1
2
3
4
5
6
7
8
9
|
foreach ($list in $web.Lists) { if($list.browserfilehandling -eq "Strict") { $list.browserfilehandling = "Permissive"; $list.update(); } } |
List Level
1
2
3
4
5
6
7
|
$list = $web.Lists["MyList"] if($list.browserfilehandling -eq "Strict") { $list.browserfilehandling = "Permissive"; $list.update(); } |
Hope this helps...
No comments:
Post a Comment