Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7758493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:22:30+00:00 2026-06-01T13:22:30+00:00

I am trying to upload a document to a document library for Sharepoint in

  • 0

I am trying to upload a document to a document library for Sharepoint in iOS, and having limited success.

I have used Copy.CopyIntoItems to at least get my Document to appear in the target document library, using this soap request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CopyIntoItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <SourceUrl>[server url]</SourceUrl>
      <DestinationUrls><string>[server url]</string></DestinationUrls>
      <Fields></Fields>
      <Stream>[base 64 encoded string]</Stream>
    </CopyIntoItems>
  </soap:Body>
</soap:Envelope>

This gets me to at least have my documents appear in my library. However, the response doesn’t give me any metadata about them (like GUID, etc.), which makes it harder to manage on my end. Additionally, when viewing the item in a browser, I have additional options for actions, like “View Source Item”, and when deleting an extra prompt stating “This item was copied from another location…”. As it is mostly the Bobs who use SharePoint, this will only serve to confuse them. Ideally, the document’s actions would look the same as when uploading directly through the document library in a browser. The more transparency is better.

The other common solution I’ve seen online has been to use a combination of Lists.UpdateListItems and Lists.AddAttachment. I’ve gotten Lists.UpdateListItems to work properly and create a new entry (and this is nice because it gives me metadata back like GUID, and at least at first glance appears the same as a form-uploaded document). However, Lists.AddAttachment won’t work for me. Using this SOAP request for the AddAttachment (The GUID is the newly added item’s GUID with UpdateListItems):

<?xml version="1.0" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <AddAttachment xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Test</listName>
      <listItemID>{1F214D95-B92B-4E10-8B96-4B04DC6DA9B6}</listItemID>
      <fileName>screenshot.png</fileName>
      <attachment>[base 64 string]</attachment>
    </AddAttachment>
  </soap:Body>
</soap:Envelope>

I get the following response:

<?xml version="1.0" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <soap:Fault>
      <faultcode>
        soap:Server
      </faultcode>
      <faultstring>
        Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
      </faultstring>
      <detail>
        <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
          Input string was not in a correct format.
        </errorstring>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

Any ideas? I’m sure I’m going down the wrong path somewhere, I’m just not sure where. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:22:31+00:00Added an answer on June 1, 2026 at 1:22 pm

    Got it working this morning. I ended up doing the simplest approach, which I was honestly never expected would work with a Microsoft API.

    NSString *fullPath = @"https://site/library/folders/document.txt";
    NSURL *url = [NSURL URLWithString: fullPath];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    request.HTTPMethod = @"PUT";
    request.HTTPBody = [NSData {documentData}];
    
    //this is the authentication Cookie acquired in a previous request.
    [request addValue:cookie forHTTPHeaderField:@"Cookie"];
    [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    

    The key seems to be using PUT as the method.

    It’s important to note, unfortunately, that this suffers from the problem above of limited meta-data returned, but because the behavior is so similar to uploading directly through the a SharePoint web site, I decided it was okay. I’m probably just going to rework the logic where I decide whether to download/update an existing document or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to SharePoint. I'm trying to upload a document to SharePoint using it's CopyIntoItems
I'm trying to upload a word document I have created in memory to Sharepoint
I am trying to upload many documents to a library of SharePoint 2007, but
I'm trying to upload documents to SharePoint using web services attaching custom metadata to
I'm trying to upload an application to the iPhone App Store, but I get
I'm trying to get a file upload progress bar working in a rails 3
This used to work in the past, but recently I've been trying to upload
I'm having problems trying to upload files using the latest XHR 2 along with
i am trying to do a program to upload a document in one page
I am trying to upload a file to a server, and have my DOM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.