Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SharePoint Web Services上载带有元数据的文件_Sharepoint_Sharepoint 2010 - Fatal编程技术网

使用SharePoint Web Services上载带有元数据的文件

使用SharePoint Web Services上载带有元数据的文件,sharepoint,sharepoint-2010,Sharepoint,Sharepoint 2010,我正在尝试使用SharePoint Web Services上载包含元数据的文件。我采用的第一种方法是使用WebRequest/WebResponse对象,然后使用Lists.asmx-UpdateListItems方法更新元数据。这很好,但是它创建了两个版本的文件。我采用的第二种方法是使用Copy.asmx web服务和CopyIntoItems方法,该方法将文件数据与元数据一起复制。这很好,创建了v1.0,但是当我尝试上载同一个文件并对元数据进行一些更改时(使用Copy.asmx),它不会更

我正在尝试使用SharePoint Web Services上载包含元数据的文件。我采用的第一种方法是使用WebRequest/WebResponse对象,然后使用Lists.asmx-UpdateListItems方法更新元数据。这很好,但是它创建了两个版本的文件。我采用的第二种方法是使用Copy.asmx web服务和CopyIntoItems方法,该方法将文件数据与元数据一起复制。这很好,创建了v1.0,但是当我尝试上载同一个文件并对元数据进行一些更改时(使用Copy.asmx),它不会更新任何内容。是否有人遇到过相同的问题或有其他想法来实现所需的功能

谢谢,
Kiran

这可能有点像个话题(对不起),但我想建议您在远程使用SharePoint时使用实时节省的快捷方式

它使您能够使用SQL和存储过程处理SharePoint列表和文档库

将文件上载为字节数组

...
string sql = "CALL UPLOAD('Shared Documents', 'Images/Logos/mylogo.png', @doc)";

byte[] data = System.IO.File.ReadAllBytes("C:\\mylogo.png");
SharePointCommand cmd = new SharePointCommand(sql, myOpenConnection);
cmd.Parameters.Add("@doc", data);

cmd.ExecuteNonQuery();
...
上传流输入

using (fs == System.IO.File.OpenRead("c:\\150Mb.bin")) {
    string sql = "CALL UPLOAD('Shared Documents', '150Mb.bin', @doc)";
    SharePointCommand cmd = new SharePointCommand(sql, myOpenConnection);
    cmd.Parameters.Add("@doc", fs);
    cmd.ExecuteNonQuery();
}
有很多方法可以简化远程文档管理

UPLOAD(lisname, filename, data)
DOWNLOAD(listname, filename)
MOVE(listname1, filename1, listname2, filename2)
COPY(listname1, filename1, listname2, filename2)
RENAME(listname, filename1, filename2)
DELETE(listname, filename)
CREATEFOLDER(listname, foldername)
CHECKOUT(list, file, offline, lastmodified)
CHECKIN(list, file, comment, type)
UNDOCHECKOUT(list, file)

干杯

您使用的是SharePoint 2007还是2010?我们使用的是SharePoint 2010。我真的不想在您描述的工具上花钱,但我得说-我真的很喜欢解决问题的其他方法。此工具完全避开了所有web服务身份验证内容(假设使用SP web服务)。。。