Solved

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

Posted on 2014-11-11
1
801 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 31

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
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…

740 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