在CSOM中将文档上载到SharePoint文档库时更新URL [英] Update URL while uploading document to SharePoint Document library in CSOM

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

问题描述


我正在尝试使用CSOM将文档上传到SharePoint文档库时更改URL。


描述:


我们有'XYZ'文档库,文件夹结构如下:


1。文件夹1


       - 子文件夹1      


                  - 所有文件     


现在,我正在尝试在"文件夹1"上传文档,然后将"拖放"文档上传到"文件夹1"。我想在这里做的是,每当用户尝试在"文件夹1"中上传文档时,它应该被上传到"子文件夹1"。在上传时,是否有
以任何方式更改CSOM中文档的URL。因此,即使用户正在进行拖放操作,它也会上传到"子文件夹1"。到'文件夹1'。


我在state.Status = Uploading event中获取当前文件夹URL。我想通过向currentURL添加"子文件夹1"来更新此URL,以便将此文档直接上传到更新的URL。


注意:如果您有任何其他方法,请让我知道。我想用CSOM做这件事。


问候,


Sudheer




谢谢和问候,Sudheer

解决方案


您可以为此库创建工作流,然后更新项目路径和名称属性。


以下是样本测试用例。


您可以根据服务器相对URL属性添加检查文件URL的条件。








最好的问候,



Hi,

I am trying to change URL while uploading document to SharePoint document library using CSOM.

Description:

We have 'XYZ' document library with following folder structure:

1. Folder 1

       - Subfolder 1      

                 - All Documents     

Now, I am trying to upload document at ‘Folder 1’  and after Drag and Drop document is getting uploaded to ‘Folder 1’. What I want to do here is, Whenever user try to upload document in ‘Folder 1’, it should get uploaded to ‘Subfolder 1 ‘. Is there any way to change URL of document in CSOM while its getting uploaded. So that it will get uploaded to 'Subfolder 1' even though user is doing Drag&Drop  to 'Folder 1'.

I am getting current folder URL in state.Status= Uploading event. I want to update this URL by adding 'Subfolder 1' to currentURL , so that it will upload this document direct to updated URL.

Note: If you have any other way to do it please let me know. I want to do this using CSOM.

Regards,

Sudheer


Thanks & Regards, Sudheer

解决方案

Hi,

You could create a workflow for this library and then update the item Path and Name property.

Here is sample test case.

You could add condition to check file url based on Server Relative URL property.



Best Regards,

Lee


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

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