使用UpdateListItems添加附件? [英] Add Attachment with UpdateListItems?
本文介绍了使用UpdateListItems添加附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用UpdateListItems将附件添加到新列表项?
Is it possible to add an attachment to a new list item with UpdateListItems?
我已经尝试过这种SOAP,但是没有骰子....
I've tried this SOAP, but no dice....
有人可以和我分享正确的SOAP结构来完成此工作吗?
Can someone share with me the proper SOAP structure to get this done?
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:UpdateListItems>
<ns1:listName>Some Calendar</ns1:listName>
<ns1:updates>
<Batch OnError="Continue" ListVersion="1">
<Method ID="1" Cmd="New">
<Field Name="ID">New</Field>
<Field Name="Title">Some Title</Field>
<Field Name="EventDate">2010-11-01 07:30:00</Field>
<Field Name="Attachments">
<Value Type="Attachments">/tmp/details.xml</Value>
</Field>
</Method>
</Batch>
</ns1:updates>
</ns1:UpdateListItems>
</ns0:Body>
</SOAP-ENV:Envelope>
谢谢!
推荐答案
找到了我问题的答案.显然,无法使用getlistitems将文件附加到项目.创建项目时必须获得_ows_ID值,然后对项目的ID值使用AddAttachment方法.
Found the answer to my question. Apparently, using getlistitems to attach a file to an item is not possible. You have to get the _ows_ID value when creating the item, then use the AddAttachment method on the ID value of your item.
这篇关于使用UpdateListItems添加附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文