Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now