Hot answers tagged

46

Although in most of the UI and API they can be manipulated the same way, there are some significant differences between Lists and Libraries. The latter is a specialized type of the former. Lists: Can have attachments Have major versions only Do not have Check-in/Check-out features Libraries: Cannot have attachments (files are directly in the library) ...


16

A library is "just" a special type of list where the focus is on the File linked to the listitem Anything you can do with a list you can do with a library and then some Note: Search acts very differently with documents in a library than it does with documents stored as attachments in a list. In A library, search indexes 'reads' every word of the ...


11

The code loops through entire site and gives the size of all document libraries. [System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) [System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”) [System.Reflection.Assembly]::Load(“Microsoft.SharePoint.Portal, ...


11

Modify the view and select "Title" column instead of Title (linked to item with edit menu) . If you want Title column to be clickable, which opens the item itself then select Title (linked to item) column. For Library use Name (linked to document) column if you need to open the document on click of name.


9

Great Info! In an attempt to make a more exhaustive comparison (because none exist!) here are a couple of things left out: List list attachments are not indexed. This has a lot of implications. When searching, you cannot use the refiners to narrow down the doc type List attachments will not work with the eDiscovery feature No location based default column ...


8

Your example contains the following errors/typos: To get fs object type use the following syntax: var fsObjType = selectedItem.get_fileSystemObjectType(); Another point is, ListItem object have to be requested first before getting it's value, this is why in your example it will not work. In fact, you don't have to request ListItem object in order to ...


8

A little JavaScript employing jQuery does the job just perfectly. $(document).ready( function () { // has to be on an interval for grouped doc libraries // where the actual links are loaded only once a group // is expanded setInterval( function () { $("a[onclick*='return DispEx'][target!='_blank']") .attr("...


7

I know this is an old thread, but after spending a good while looking about I found an OOTB SharePoint Designer 2010 solution for this problem. To move a document to a different folder create an SPD2010 workflow and use the Update Item action to change the path and name of the document. After inserting the update list item action click on the "this list" ...


7

At least three options are available: Option 1 Retrieve File Url via projected File object: /_api/Web/Lists/getByTitle('<list title>')/items?$select=File/ServerRelativeUrl&$expand=File Option 2 Retrieve File Url via FileRef property: /_api/Web/Lists/getByTitle('<list title>')/items?$select=FieldValuesAsText/FileRef&$expand=...


7

The default setting for SharePoint 2013 is two days, which you can check using this script: $WebApp = Get-SPWebApplication http://portal $WebApp.DaysToShowNewIndicator 2 You can change the number of days the same way: $WebApp.DaysToShowNewIndicator = 5 $WebApp.DaysToShowNewIndicator 5 Reference: NEW INDICATOR IN SHAREPOINT LISTS AND LIBRARIES – NUMBER OF ...


6

you can create a new column to use as your filter say Sr# and assign the number to this column. Change the values according to the order, by which you want to display the items. Edit the view and Sort by this column name.


6

I created this simple PowerShell script to calculate for a single Document Library what the size in MB is for all the files inside: $total = $null; ((get-spweb http://WebApplication/SiteCollection/subsite/).lists | Where-Object {$_.title -eq "Library Title"}).items | foreach {$total+= $_.file.length}; $total /1MB Before you can use the script you need to ...


6

Those groups will not be able to access the folders if the permission for the folder is broken and only the group "XYZ" has permissions to the folder and rest all are removed. UPDATE Sample powershell code: $folders = $list.Folders foreach ($spFolder in $folders) { $PermissionLevel = "PermissionName" ; $group = $web.SiteGroups[$GroupName]; ...


6

Copy the URL of the destination folder from the address bar. Navigate to where you see your document in the library. Either from the pulldown or by selecting the document and choosing Send To from the ribbon. Select Other Location and paste your destination. Sorry it is only one document at a time.


6

Out of the box, this isn’t possible. You can, however, restrict both download and printing with Information Rights Management for all users, but not for a group of users. And since there is a snipping tool and a print screen function on all operating systems, users can with a little effort still get the content of document and save it somewhere else. So this ...


6

You can get content type id from its name. Just you have to use $filter. "/_api/web/AvailableContentTypes?$select=Name,Id,StringId&$filter=Name eq 'Your CT Name'" Just make a GET request to the above end-point. PS: Id is a object. So better you can consider to $select StringId in your query.


6

Install the May 2017 PU and try that. There was a bug, though I thought it was exclusive to 2013 with opening files where the path contained a space.


5

You can't push the file to the client from the server. The server side has no knowledge of the client side. You have to write a client application, that will pull the file. First, you'll have to know the url of the file. Then, a simple var wc = new WebClient(); wc.UseDefaultCredentials = true; wc.DownloadFile(targetFile, @"c:\temp\myfile.txt"); would do ...


5

Its because the Home.aspx (may be another page in your case) is set as a welcome page for the library root folder. Below should fix it $web = Get-SPWeb "http://site" $list = $web.Lists["Site Pages"] $rootfolder = $list.RootFolder $rootfolder.WelcomePage = "Forms/AllPages.aspx" $rootfolder.Update() Write-Host $list.RootFolder.WelcomePage $web.Dispose()


5

You could rely on Information Management Policies and setup a Retention policy to either archive, remove, etc (http://www.dynamics101.com/2013/03/sharepoint-information-management-policy/ or http://office.microsoft.com/en-001/sharepoint-server-help/create-and-apply-information-management-policies-HA101631505.aspx)


5

You only see the last error because Set-Content overwrites the existing content, use Add-Content instead. If you want to have a more encompassing approach, like Robert suggested, there's a more PowerShell'y (?) way of doing this with Start/Stop-Transcript which takes all console output between the Start & Stop cmdlet calls and outputs it to a file.


5

Why not open the site in IE, open the library using "Open in Explorer Mode" from the ribbon, select all, right click and choose Properties, that should give you the actual size.


5

This is a file that's located on the server's file system. Microsoft definitely doesn't recommend changing this file for the following reasons: Having multiple web front ends means you will have to change the page layout on each of these servers. If the different servers are using different files on their file system, different users will get different ...


5

Lookup columns can only be based on 'Single line of text', 'Number' or 'Date and time' columns see Create list relationships by using unique and lookup columns So your only option would be to create a 'Single line of text' column and have an event receiver or workflow populate this with the wanted information from the person in the owner field.


4

Simple answer: you can't. You are thinking of SharePoint as if it is a file system, which it is not. To organise content into "folders" you'd need to create subwebs and move libraries there. But the wiser thing to do would be to correctly assign content types and metadata to your documents, then use search to find what you need. I know this is a very ...


4

The simple approach would be to create a list in a site, define the fields you wish to keep track of (title, ISBN, abstract, etc). Then make sure that all of the people that you wish to be able to use the list have 'Contribute' permissions. If the library is self-managed then require checkout to modify an item. Then, the user can merely 'Check out' the ...


4

Edit: That dialog cannot be changed for an individual library. It's the default new page dialog for the whole site collection. You would need to write code to change that. Out of the box, just create the page, then click the Page ribbon and use the "Edit Properties" command to set the required fields. In this question a code solution is linked, but it ...


4

To create a Document library: New-SPList -Web http://spwebaddress -ListTitle “Enter Title Here” -ListUrl “ListURL” -Description “Description” -Template “Document Library” To upload to a folder within document library you should get the spfolder then add to it... $folder=$web.GetFolder(“FolderName″) $folder.Files.Add($folder.Url + “/” + $file.Name, [System....


4

You need to retrieve SPWebApplication.DaysToShowNewIndicator and the build a query to retrieve documents created within that number of days. For more code see Getting the list of new items from code


4

So, when you reference a dll created in a different project and reference it in your SP project, you need to add it to the Package. To make Visual Studio adding 3rd party assembly or even your own assembly from other project in solution to GAC please do next: Open Package.package from Package folder in SharePoint project. Click Advanced in bottom area. ...


Only top voted, non community-wiki answers of a minimum length are eligible