在共享点文档库中上载文档 [英] Upload document in Share point Document Library

查看:122
本文介绍了在共享点文档库中上载文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

在这里,我的问题是我们可以从Web部件后面的代码向库中添加文档吗?
如果可能的话.添加文档的代码是什么.

谢谢,
Sugumaran

Hi Friends,

Here my question is can we add document to library From code Behind Web part.?

If Possible. what is the code to add the document.

Thanks,
Sugumaran

推荐答案

是的,可以通过代码将文档添加到文档库中,使用Sharepoint的 Copy service 的CopyIntoItems方法. br/>
Yes it is possible to add documents to the document library from code, use the CopyIntoItems method of Copy service of Sharepoint.

CopySoapClient client=new CopySoapClient();                        client.CopyIntoItemsCompleted += new EventHandler<copyservice.copyintoitemscompletedeventargs>                   (client_CopyIntoItemsCompleted);

client.CopyIntoItemsAsync(sourceUrl, destination, fieldInfo, byteArr);



其中sourceUrl是要上传的文件的名称
目标是包括"SharePointSite" +"DocumentLibrary" +"FileName".
fieldInfo是字段信息.
ByteArr是作为流的文件.



where sourceUrl is the name of the file to be uploaded
destination is the includes "SharePointSite"+"DocumentLibrary"+"FileName".
fieldInfo is the Field information.
ByteArr is the File as stream.


这篇关于在共享点文档库中上载文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆