Tag Info

Hot answers tagged

2

Below code will create and update a document: public void UpdateAndCreateFile(SPWeb web) { try { SPSecurity.RunWithElevatedPrivileges(delegate() { string TemplateUrl = string.Empty; try { TemplateUrl = "Your ...


2

If I understand you correctly there are 5 metedata,columns that automatically created when the word document is created. In your word template on the insert tab, go to the "Quick Parts" and select document properties. If those fields are attached to your content type you should see them there. Add them to your Word Document template wherever you want then to ...


2

If you get an error adding SharePoint DLL which states Could not load file or assembly 'microsoft.sharepoint, Version=12.0.0.0 you can try using this script instead [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") and you can continue exporting the WSP from your 2007 environment $farm = ...


2

Here is a generic idea Using stsadm -o enumsolutions get all installed solutions on the farm Then for each solution you need to download it using following technique [Enable Powershell] (http://support.microsoft.com/kb/968930) [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Cult ure=neutral, PublicKeyToken=71e9bce111e9429c") ...


2

You can deploy apps locally if you have the app package. You upload them into the site catalog and they will be made available to your site collections. You won't be able to utilize apps deployed to the MS store. You would need to contact the vendor directly to see about obtaining an .app package or code your own and deploy them.


1

After a long day, it turned out that for successfully using the Powershell DownloadFile() method, in my environment (SP2013 with ADFS) following two lines did the trick(at least for me). $wc.UseDefaultCredentials = $true $wc.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") So, the final code looks like, $FilePath = ...


1

Try this $wc = New-Object System.Net.WebClient $wc = New-Object System.Net.Networkcredential(Username, Password) $UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)" $wc.Headers.Add([System.Net.HttpRequestHeader]::UserAgent, $UserAgent);


1

Thanks for the responses, Actually I came across a remedy in a similar article Referring to tha post answer, in my code I invoked the below javascript OnClientClick event of the LinkButton. function setFormSubmitToFalse() { setTimeout(function () { _spFormOnSubmitCalled = false; }, 3000); return true; }


1

I was trying James' solution but was having problems building the correct URL of the document. To get the URL you can: Open Dev Tools (F12) Open the Network tab Click the download a copy button for the document you want the link for The HTTP GET request URL will appear in the network tab.


1

You could always create your own download link, making use of the internal download application page in SharePoint. To create a link to download a video (or any other item that resides in the SharePoint), just create an good old anchor link as in my example and place in a script editor on a page. The key that makes this work is this part that allows you to ...


1

Try adding: context.Response.AddHeader("content-disposition", "attachment;filename=" + file.Name);


1

According to SharePointOnlineCredentials class from SharePoint Online Client Components SDK the expiry date for authentication cookie (SPOIDCRL) should be set to 1 hour The following example demonstrates how to provide SPOIDCRL HTTP header in order to perform request authentication in SharePoint Online/Office 365: var request = ...


1

Sandbox solution runs on its own process. Hence the HttpContext you are using will not work. Write file to response problem


1

Assuming you have the MemoryStream, the below code will bring the Save Dialog so user can choose the path Byte[] byteArray = memoryStream.ToArray(); memoryStream.Flush(); memoryStream.Close(); Response.Clear(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition","attachment; filename=filename.zip"); Response.ContentType = ...


1

Ok, I solved it as follows (inspired by this post) - might be helpful for someone else... The idea is to start from the back, removing more and more tokens between '/' from the path until we find the lowest level site URL, which we then use to instantiate the correct ClientContext for the given folder url. The folder itself can then be referenced using ...


1

Can't give a definite answer without seeing the environment, but I would try, in order: IISReset (could be a simple caching glitch) Clear browser cache (from the F12 menu) Temporarily set the master page back to default and see if the issue recurs. Make a copy of the library and check if it recurs there



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