Showing posts with label Sharepoint Document Library. Show all posts
Showing posts with label Sharepoint Document Library. Show all posts

Friday, December 2, 2016

Delete all files & folders from SharePoint library

Add-PSSnapin Microsoft.SharePoint.PowerShell

# Replace siteurl with actual web url
$web = Get-SPWeb -Identity "siteurl"
# Replace docurl with document library url
$list = $web.GetList("docurl")

function DeleteFiles {
    param($folderUrl)
    $folder = $web.GetFolder($folderUrl)
    foreach ($file in $folder.Files) {
        # Delete file by deleting parent SPListItem
        Write-Host("DELETED FILE: " + $file.name)
        $list.Items.DeleteItemById($file.Item.Id)
    }
}

# Delete root files
DeleteFiles($list.RootFolder.Url)

# Delete files in folders
foreach ($folder in $list.Folders) {
    DeleteFiles($folder.Url)
}

# Delete folders
foreach ($folder in $list.Folders) {
    try {
        Write-Host("DELETED FOLDER: " + $folder.name)
        $list.Folders.DeleteItemById($folder.ID)
    }
    catch {
        # Deletion of parent folder already deleted this folder
    }
}

Monday, March 7, 2016

File size limit and/or update count limit List and Library



Maximum file size limit is 2 GB

Default values are:

For SharePoint 2013: default max file size is 250 MB
For SharePoint 2007/2010: default max file size is 50 MB











https://technet.microsoft.com/en-us/library/cc262787(v=office.14).aspx#ListLibrary

Thursday, February 18, 2016

Drag & Drop in SharePoint Document libraries in SharePoint 2010

Please follow the below url step
In that article ,Have script file we have to add content editor webpart.

Some restriction will be restrictions. 


http://dandd.codeplex.com/

Wednesday, May 13, 2015

SharePoint : How to open pdf document in the new tab document library in SharePoint 2013

Best way o use client side rendering ,below code will implement the script

<script type="text/javascript">

    $(function () {

        $("a[href$='.pdf']").removeAttr("onclick");

        $("a[href$='.pdf']").removeAttr("onmousedown");

        $("a[href$='.pdf']").attr("target", "_blank");       

    });

</script>