Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am new with sharepoint and I have a problem with uploading files to my site. I am creating Python application communicating with sharepoint by SOAP webservices.

I was able to create new List called "data" and new list item with title "new_file.dat". It created an item with name "5_" and refering to file "5_.000" (which is not found now - 404). Now I want to append an attachement to it by this SOAP command

<?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>
        <AddAttachment xmlns="http://schemas.microsoft.com/sharepoint/soap/">
            <listName>data</listName>
            <listItemID>5</listItemID>
            <fileName>new_file.dat</fileName>
            <attachment>QUJDREVGR0hJSktMTU5PUA==</attachment>
        </AddAttachment>
    </soap:Body>
</soap:Envelope>

The item id is 5 (I found it by GetListItems as ows_ID) and the attachement is only an example of base64 encoded string (the data file).

Here is the problem, the sharepoint still gives me an error 500 with errorstring: "Value does not fall within the expected range" and does not attached the file.

The way of sending the command is probably ok, because all other services works fine for me.

Thank you for any suggestions or hints what I do wrong.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Finally, I found the answer. The problem is that if I upload file to Documents it requires a method Copy.CopyIntoItems and adding attachement is not possible.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.