Solved

C# program that uploads files to sharepoint (409) Error  when using the  Microsoft.SharePoint.Client.File.SaveBinaryDirect

Posted on 2014-11-11
1
818 Views
Last Modified: 2014-11-11
I keep getting 409 sharepoint error.  I dunno why when uploading files. code is below

 using (ClientContext clientContext = new ClientContext(SharePointRootURL())
                    {
                        clientContext.Credentials = GetSharePointCredentials();

                        var thisFileStream = System.IO.File.OpenRead(FilePath);

                        string FileName = System.IO.Path.GetFileName(FilePath);
                       
                        Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, String.Format(SharePointMemberPartnerReportLocation(), MemberPartnerFirmURL) + FileName, thisFileStream, true);
                       
                        thisFileStream.Close();
                    }
0
Comment
Question by:cbrune
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 32

Accepted Solution

by:
Jamie McAllister MVP earned 500 total points
ID: 40436043
Is your code deffo putting a forward slash character between the MemberPartnerFirmURL and the Filename?

Since a 409 is about a rules conflict think about what rules may be being contravened. Are there existing files being overwritten?

http://www.checkupdown.com/status/E409.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question