.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Sharepoint 2010 uploading documents programatically

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
Hi All I'm a newbie and hoping that someone can help me with a problem that I am having. I have written a WinForms app to upload documents to Sharepoint 2010 document library using client object model. It works great unless the file is more than 3MB. The error returned is "The remote server returned an error (400) Bad Request". The files are being uploaded from my local machine to the SharePoint 2010 site. I searched the internet for 2 days trying to find a solution to this without any joy. I have tried increasing the maxRequestLength and executionTimeout in web.config. The program uses a file stream to put the file in a btye array which then becomes the content of a filecreationinformation object. As I said, it loads files OK if they are less than 3MB, so I think that the code is OK. The max document size in SharePoint is 50mb. I really need some help please....   Blaithin

View Complete Post

More Related Resource Links

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Office Services: Merging Word Documents on the Server Side with SharePoint 2010


Office 2010 and SharePoint 2010 include a new set of components called Application Services. These put a rich set of tools in a developer's bag for Office automation. We'll show you how to use Office OpenXML, Word Automation Services and SharePoint to build a simple application that merges separate status reports into a single document.

Manvir Singh, Ankush Bhatia

MSDN Magazine July 2010

SharePoint 2010 Long Starting if start workflow programatically


In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

					SPList currentList = web.Lists[new Guid(ListId)];
					SPListItem currentListItem = currentList.GetItemById(ListItem);

					//resolve any lookup parameters
					string workflowId = base.ProcessStringField(WorkflowIdentifier);

					//find workflow association by name
					SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, Thread.CurrentThread.CurrentCulture);

					if (workflowAssoc != null)
						//start the workflow
						SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, workflowAssoc.AssociationData, SPWorkflowRunOptions.Synchronous);

And workflow #2  will hang with Starting status (1-10 minutes), Then the workflow #2 status would be modified  to Completed.

I couldn't find how to start the workflow # 2 immediately and complete immediately without several minutes delay

Assembling Documents on SharePoint 2010 Sites by Merging Content from Excel, PowerPoint, and Word

This article describes a rich document assembly solution that takes Word 2010 documents, Excel 2010 documents, and PowerPoint 2010 documents and merges them together to form a final report in Word. It does all of this from a SharePoint 2010 Web Part.

Converting Word Documents to PDF using SharePoint Server 2010 and Word Services (Visual How To)

Watch the video and explore code as you learn how to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010.

Sample: Converting Word Documents to PDF using SharePoint Server 2010 and Word Automation Services

Explore the code in this visual how-to article as you learn how to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010.

Video: Converting Word Documents to PDF Format Using SharePoint Server 2010 and Word Services

Watch this visual how-to video as you learn how to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010. (Length: 6:15)

Office 2010 will not open Office 2003 Documents on SharePoint

Going directly to a document in the document view and selecting any of them will present the Read Only/Edit prompt and when clicking Read Only Word or Excel 2010 depending on the document type will open to a blank page and just sit there. If you do a search and then click on the documents that are returned in the search results, it opens as expected.

how to open force SharePoint 2010 to open documents withint the browser instead of invoking word app

guys, when user clicks on the word document within a document library, it opens up in the word IDE , how can i change this so that documents opens up in the browser. the "Library settings\ advanced settings\ open documents in the browser" setting is set to "open in the browser"   thanks sameer

Upload documents to Sharepoint 2010 Document library

Is there a way to upload documents to an SP 2010 document library with Custom Actions or Workflows?  I have a requirement of taking the contents of several directories (older data files) and uploading them to Sharepoint.  Not sure which actions actually perform this operation.  Any help most greatly appreciated.

Publishing SharePoint 2010 via TMG 2010 SP1, Cant save any documents.

Hi, I have setup the publishing of a SharePoint site through TMG and appeared to have no issues. I am able to check documents in and out that I have uploaded but cannot save any to document libraries. I cant edit any docs and write them back to the library. It comes up with "document not saved" or that the doc is "Locked for editing by someone else." I realise there are a lot of variables involved in the setup here and wish to be pointed in the right direction to finding a fix. I have turned on monitoring in TMG and every connection I make is allowed and appears to be fine. I have looked at logging on SharePoint but cannot find the right one to turn on? Any help would be much appreciated. Thanks, Mark 

How to save Office 2007 documents to SharePoint 2010 sites

Is it possible to save Office Word/Excel/Powerpoint 2007 to SharePoint sites directly from Office Clients? Following website helps with saving a Office 2010 document to SharePoint 2010, but how to do it with Office 2007? http://office.microsoft.com/en-gb/word-help/save-a-document-to-sharepoint-from-office-2010-HA010380214.aspx  Kenny_I

How to Programatically SetCredentials for Secure Store Service Application in Sharepoint 2010 using

I have to setup Credentials for Secure Store Service application programatically. To get Stored Credentials I have following code and its working fine. using (SPSite site = new SPSite("http://vtlssp2010Dev")) //using (SPSite site = new SPSite("http://" + System.Environment.MachineName + "/sites/Site_Name"))d { Console.WriteLine(site.RootWeb.CurrentUser.Name); SPServiceContext context = SPServiceContext.GetContext(site); prov.Context = context; try { SecureStoreCredentialCollection cc = prov.GetCredentials(appID); foreach (SecureStoreCredential c in cc) { IntPtr ptr = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(c.Credential); string sDecrypString = System.Runtime.InteropServices.Marshal.PtrToStringUni(ptr); Console.WriteLine(sDecrypString); } } catch (Exception ex) { Console.WriteLine("Unable to get credentials for application " + appID); Console.WriteLine(ex.Message); } Console.ReadLine(); } } All I want is to programmatically do set credentials like explained in this example on msdn. http://msdn.microsoft.com/en-us/library/ff798456.aspx Please help. Shamshad Ali  

Documents are not getting crawled in Sharepoint 2010

I am not able to crawl the documents in Sharepoint 2010 RTM Version. But when i open the document properties and save it the document is getting crawled. I am uploading the documents via object model.   Any help on this would be great.vinod kumar Bhasyam

Publish Office 2007 documents with metadata to SharePoint 2010?

Hi. I have SharePoint 2010 Enterprise based Intranet solution. We are publishing office 2007 documents to various document libraries there. When uploading documents normally to the document library, I can enter managed metadata to the documents which are later sorted and filtered by this metadata. But how can I enter metadata at the point where I'm publishing the document(Publish->Document Management Server)? I can get the document management pane to show my metadata -column in word as a textbox after the document is published, but the textbox is colored grey and says that I should modify that data on the server i.e. from sharepoint.

Uploading doc file into SharePoint Document library Programatically.

Hi all, I want to upload the doc file into SharePoint document library using the FileUpload control. For that I am created a new document library in my SharePoint site. But I am not getting the path of Document library where I want to upload the file. Waiting for your valuable response. Regards,-Kaustubh

Can't open SharePoint documents in Office 2010

Hi, I have a SharePoint 2010 standalone installation and a SP 2007 with SQL back-end installation for testing and proof of concept demonstrations.  All the servers are running Windows 2008 Server and are on a vSphere 4.0 ESX server as virtual machines. Most of the pilot team are on Office 2007 and are working fine with the installations.  I am running Office 2010 (not beta) and am unable to open any Word or Powerpoint files in a standard Project site's Shared Documents library. (I can open a word document stored and linked from a publishing site.) Whether I browse to the file or click the link in a search results page, Powerpoint and Word load up but before I get any login prompt or application screen appearing, the application crashes.  This occurs whether I open the document Read only or click the implicit check out 'Edit' button. If I check the document out to my local drafts folder I can open normally.  As I can't find anything about this on the internet I'm guessing it's not a common occurence!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend