sharepoint-2013

Download file from SharePoint

自闭症网瘾萝莉.ら 提交于 2019-12-04 15:28:37
I'm using the REST APIs of SharePoint to query the files hosted inside a corporate user's Office 365 SharePoint site. I have used OAuth to authenticate the user and authorize the the app, as described here: http://msdn.microsoft.com/en-us/library/azure/dn645542.aspx I am able to successfully query the API with a GET request on: https://XXXXXXX.sharepoint.com/sites/xxxxx/xxxxx/myfoldername/_api/files (the request as the Authorization header set to 'Bearer ', as you'd expect.) The above query gives me the following JSON result: { "odata.metadata" = "https://xxxxxxxxx.sharepoint.com/sites

Optimal/preferred way to call 'SP.ClientContext.executeQueryAsync' in SharePoint

蓝咒 提交于 2019-12-04 09:25:12
问题 I have been learning client-side object model and came across the method executeQueryAsync. I found there are quite a few ways to call this method. Some of the one I found were these: var context = new SP.ClientContext.get_current(); // Option 1 context.executeQueryAsync( function(sender, args){ }, function(sender, args){ } ); // Option 2 context.executeQueryAsync( Function.createDelegate(this, _onSucceed), Function.createDelegate(this, _onFail) ); // Option 3 context.executeQueryAsync(

Creating Folders programmatically in SharePoint 2013

喜你入骨 提交于 2019-12-04 09:15:00
问题 Currently I have code that creates a Folder in the Documents directory when run: using (var context = new Microsoft.SharePoint.Client.ClientContext(sharePointSite)) { context.Credentials = new Microsoft.SharePoint.Client.SharePointOnlineCredentials(user, password); Web web = context.Web; Microsoft.SharePoint.Client.List docs = web.Lists.GetByTitle(<upper level folder>); docs.EnableFolderCreation = true; docs.RootFolder.Folders.Add(folderName); context.ExecuteQuery(); return true; } I am

Sharepoint 2013 deleting contents of <style> in embed code when saving

99封情书 提交于 2019-12-04 09:12:29
问题 I am trying to add some styling to a Sharepoint 2013 page using the Embed code facility. It works fine until I save the page and then it deleted all the text between the <style> and </style> tags? So I click embed code on the page and enter the following <style> .sampleStyle {color:#fff} </style> When its saved and re-opened I find sharepoint has changed the code to this <style unselectable="on"> </style> 回答1: It can be done. In my frustration this morning, I was adding information in the

How to copy file using Rest API and javascript in Sharepoint 2013 between site and subsite

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 09:05:06
I need to copy file between document libraries. Library A is located in one site and Library B is located in subsite. I know how to copy file between libraries on the same level but the problem is with copying between different level. The code I use to copy file between libraries on the same level. $.ajax({ url : "http://xxx/PWA/_api/web/folders/GetByUrl('/PWA/CopyFromLibrary')/Files/getbyurl('Import.csv')/copyTo(strNewUrl = '/PWA/TargetLibrary/Import.csv',bOverWrite = true)", method: 'POST', headers: { "Accept": "application/json; odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val()

The proper way to write a SharePoint User to a User Field in a SharePoint list

痴心易碎 提交于 2019-12-04 08:58:55
I'm writing a user to a SharePoint list. I've read that the SharePoint User field has a string like this inside of it: userId;#userLoginName I've tried formatting in the same way when writing to a User field, for example when I write this string it works: 9;#i:0#.f|membership|ectropy@example.org But what is strange (to me at least) is that 9;# seems to work or even 9 . Even if I don't pass the userLoginName info at all, the loginId seems to be enough for it to recognize which User I'm talking about. This seems to imply that when writing to the SharePoint User field, you only need the id, and

GridView SelectMethod Issue With WebPart Sharepoint 2013

家住魔仙堡 提交于 2019-12-04 06:39:09
问题 Hi every one , I have a problem with a gridview in webpart sharepoint 2013 ,I use model bind with the gridview and I have assigned a select method to the gridview when I deployed the webpart it raise the following error A public method with the name was either not found or there were multiple methods with the same name on the type x.master thanks alot 回答1: I have found the solution , you need to register this code within the CallingDataMethod GridView event : protected void GridView1

SharePoint Error: The server does not allow messages larger than 2097152 bytes

拟墨画扇 提交于 2019-12-04 01:04:04
I have web service that point to sharepoint 2013 Office 365. I use the client object model. I am trying to update the xml file which stores 4 attachments in it. When I do this when I have large binary data in the xml file I get the following error : Message The request message is too big. The server does not allow messages larger than 2097152 bytes. I realize I am probably going to have to seperate the attachments from the xml file but currently my infopath form stores them there. Is there a way I can increase the request length or maybe chunk up saving or something. I really just modifying

SharePoint App Deployment error : 'Failed to install app for SharePoint'

半世苍凉 提交于 2019-12-03 23:47:19
When I tried to add a SharePoint mvc app I am getting following error: Error occurred in deployment step 'Install app for SharePoint': Failed to install app for SharePoint. Please see the output window for details. Detailed stack trace: CorrelationId: 50583239-71cb-4b07-8bcb-4bbc51a22631 ErrorDetail: There was a problem with activating the app web definition. ErrorType: App ErrorTypeName: App Related ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964 at Microsoft.SharePoint

Get a list of files from Sharepoint and download the latest file

大兔子大兔子 提交于 2019-12-03 22:33:06
I am trying to get a list of files from a SharePoint location and then get the latest (by creation time) file using C#. The resources available talk about SPWeb/SPSite but these are not available directly on Visual Studio 2013; The SharePoint site: https://sharepoint.amr.<Website>.com/sites/OrganizationName/Group/Shared Documents/Reports/Area/ So far I have been unable to do so. Could anyone please provide some useful resource or examples? Gunnarsi If you're not running your code on the SharePoint server then you'll need to use the Client Object Model. Complete basic operations using