Alfresco ::如何使用REST API在文件上传期间添加自定义属性

编程入门 行业动态 更新时间:2024-10-07 18:24:32
本文介绍了Alfresco ::如何使用REST API在文件上传期间添加自定义属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

上传文件时,我正在使用以下API。

While uploading a file, I am using the below API.

localhost:8080/alfresco/service/api/upload

文件已成功在露天仓库中上传。 现在我的要求是,如果我想添加自定义属性,例如 custom1,custom2,custom3,custom4 等,您能否使用浏览器API给我们提供解决方案/ AJAX调用。

File is getting uploaded successfully in alfresco repository. Now my requirement is, If I want to add custom properties like custom1, custom2, custom3, custom4 etc Could you please give us a solution using browser API/AJAX call.

下面是我的代码

<form method="post" name="uploadForm" enctype='multipart/form-data' id="upload_form" action="localhost:8080/alfresco/service/api/upload"> <input type="hidden" name="destination" id="destination" value="workspace://SpacesStore/3f132339-bac1-4e0c-be03-b2ec5dbea61b" /> <input type="hidden" name="overwrite" id="overwrite" value="false" /> <br /> <label>custom1:</label> <br /> <input type="text" name="custom1" id="custom1" /> <br /> <label>custom2:</label> <br /> <input type="text" name="custom2" id="custom2" /> <br /> <label>custom3:</label> <br /> <input type="text" name="custom3" id="custom3" /> <br /> <label>custom4:</label> <br /> <input type="text" name="custom4" id="custom4" /> <br /> <br /> <label>File:</label> <br /> <input class="button" type="file" name="filedata" id="filedata" /> <br /> <input class="button" type="submit" name="submit" value="Upload" /> </form>

推荐答案

请阅读本教程,以便您了解如何在内容模型中定义属性

Please read this tutorial on custom content properties so that you can understand how to define your properties in the content model.

然后,您可以使用Alfresco REST API,或者最好使用CMIS API来更新属性。

Then you can use the Alfresco REST API, or preferably, the CMIS API to update the properties.

更多推荐

Alfresco ::如何使用REST API在文件上传期间添加自定义属性

本文发布于:2023-11-28 11:19:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642191.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   如何使用   文件上传   属性   Alfresco

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!