Hot answers tagged

10

You need to move the list Url to your module definition: <Module Name="Style Library" Url="Style Library" RootWebOnly="true"> for GhostableInLibrary to work properly. You should of course then remove it from the File Url, since it is now defined on module level. If you have no Url in the Module tag you can only use type="Ghostable" on your File ...


8

In order to manage unique permissions for a Securable Object like List or File (via associated List Item) or Folder (via associated List Item) there is a common approach that you could consider: Break role inheritance for a securable object Add/remove the role assignment on the securable object [optional] How to: set unique permissions for a File via ...


6

The rules are "very simple" (see the full KB article here), which is why you should alway use SPUrlUtility to check filenames. Except about folders and files: Folder names •You cannot use the following characters anywhere in a folder name or a server name: ◦tilde ◦number sign ◦percent ◦ampersand ◦asterisk ◦braces ◦backslash ◦colon ...


6

If I only want to download the stream of the file then the ClientContext object isn't that picky about the website url. The file can be easily downloaded and written to a file. Uri filename = new Uri(@"http://server/sites/site1/subsite/doclib/folder1/folder2/prettyimage.jpg"); string server = filename.AbsoluteUri.Replace(filename.AbsolutePath, ""); string ...


5

If you are asking whether you can leave files in a file share and access them through SharePoint with the out-of-the-box features then the answer is no. There are however, 3rd party solutions out there that you can look at such as the "File Share Library" by Bamboo Solutions or I believe AvePoint also has a solution. On the other hand, if you are asking ...


4

It is still not supported to upload multiple files with managed metadata or simple metadata.


3

It all depends on the application that downloads/opens the documents. First of all, when you click a document link in SharePoint (via the Browser) SharePoint will send the document back with the correct mime type (assuming it is registered and known). Depending on the settings of the Web Application (strict vs permissive file handling) not default known ...


3

To deploy your file so that SharePoint can access it, you have several options but in your case as it is needed only by your feature event receiver you can deploy it under the feature's root folder. To do so, simply put your file inside a module with a deployment type of "ElementFile". Something like: <?xml version="1.0" encoding="utf-8"?> ...


3

expanding on Annchal method you could use explorer view to do this. Time is money, your going to manually create the document library and then write and test the code which could take some time to get it correct as its over three libs on sharepoint. opening the document library in explorer view will make it easy for you to move the whole folder or copy ...


3

Sounds like the "Open in Explorer" feature is your best bet. Go to the target library, click the "Library" tab, and click "Open in Explorer" (only works in 32 bit IE). This will make the library look like a regular windows folder, from there you can copy and paste files in.


3

The user account that operates the search crawling has to be given read permission to the file share you wish to crawl.


3

No, no OOB settings can prevent a user from overwriting an existing document, unless you do one of the things suggested in the other answers OR you create an event receiver and attach it to your library. In this event receiver, for the itemAdding event handler, you then check if there's another document with the same name and in this case, you cancel the ...


3

Try deleting the items in PowerShell after setting SPWeb.AllowUnsafeUpdates = true; If that doesn't work you may need to create a new list and move the good list items there and then delete your old list using this method. After that you should be able to recreate the list with the same URL as before and move all of the items back.


3

The New Document button should open the template specified on the document library for the user. Then they can save the document back into the library. Upload Document is just that, uploads a doc. If you're seeing Upload for the New, I think this is because you either don't have a template specified for your content type, or you're on a browser that doesn't ...


3

Make JSlink load your file You can put multiple files in the JSlink where you now use: ~sitecollection\....\yourCSRfile.js They have to be separated by a ; (semi-colon) They do not have to be CSR files, can be any JS file (It is called JSlink for a reason). But they have to be in a location where JSlink may access them: ~site or ~sitecollection (and ...


2

To reference static types and enums use a [] notation: [Microsoft.SharePoint.SPCheckinType]::OverwriteCheckIn


2

Based on my research and past experience this could be an approach to download files from a SharePoint Document Library. First you get connected to the SharePoint site, and retrieve using list.GetItemById(ID) function. Once you load item object, you can get the Server Relative Url of the file. And from this Url you can download the document. You can read ...


2

Your IIS SSL configuration is not right, you are mixing client certificates with SSL server certificates. You want to use SSL Server certificates for the site, not client certificates. Disable client certificates, and configure correct SSL certificate in IIS web site bindings. Review the article for details here.


2

Try following $url = "http://myserver/sites/mysite/shared%20documents/myfile.xlsx" $web = Get-SPWeb http://myserver/sites/mysite $file = $web.GetFile($url) $lastWriteTimestamp = $file.Item["Modified"] OR $lastWriteTimestamp = $file.TimeLastModified Find all properties of SPFile in MSDN


2

That is certainly one option. Another option is to do individual site collection backups as well as full content db backups. This way, you can restore a single site collection to a separate farm, grab the file, then delete the site collection.


2

You can't use only JavaScript to do this. The CopyIntoItems method takes a byte[] stream parameter. This means you need to be able to read a file into a byte array and then pass this to the method. This first step isn't possible in JavaScript.


2

Have you looked at Site Collection Auditing? http://office.microsoft.com/en-us/sharepoint-server-help/configure-audit-settings-for-a-site-collection-HA102031737.aspx You can use the audit feature of Microsoft SharePoint Server 2010 to track which users have taken what actions on the sites, content types, lists, libraries, list items, and library files ...


2

Apparently there's a property called FileLeafRef, and I could query the library like so... $.ajax({ url: "site.url/_api/web/lists/getByTitle('LibraryName')/items?$top=1000&$select=FileLeafRef", type: "GET", headers: { "accept": "application/json;odata=verbose" ...


2

try this: $.ajax({ url: "site/_api/web/GetFolderByServerRelativeUrl('Documents')/Files", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function(data){ //console.log(data); for(var i = 0; i<data.d.results.length; i++){ var result data.d.result[i]; ...


2

On upload there is a checkbox "Overwrite current version" (or similar). This is the only setting there is. The main problem is that this option is not given if the user drag-and-drops documents to a library view!


2

If users have "Contribute" permission only and if document library sets to display only users own documents, they can not overwrite documents of eachother. If they try to save a document with same name, it will give a "Permission Denied" error.


2

Their are couple of ways to download the documents from SharePoint Document library. Using the Explorer view, you can drag and drop the documents to local directory. UNC mapping to the SharePoint document library and drag/drop documents to a file share. You could refer this blog for details. This is simplest way but it will not display files that exceed ...


2

The error: Additional information: Cannot invoke HTTP DAV request. There is a pending query. is encountered when ClientRuntimeContext.HasPendingRequest property returns true. In case of File.OpenBinaryDirect method you could use the following verification: if (ctx.HasPendingRequest) ctx.ExecuteQuery(); Example private static void ...


2

You have multiple ways of uploading a document, depending on where you code is running. Server object model: var context = SPContext.Current; // Get the web reference var web = context.Web; // Get the library reference var docLib = web.Lists.TryGetList("NAME OF THE LIBRARY HERE"); if (docLib == null) { return; } // Add the document. Y asume ...


2

You need to $select and $expand the AttachmentFiles property for your list items if you want to select many items from the list. _api/lists/getByTitle('MyList')/items?$select=AttachmentFiles,Title&$expand=AttachmentFiles Then you can get attachment info (if it exists) in the AttachmentFiles property of your list item which will be an array of ...



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