Alfresco:: How to add custom properties during fil

2019-09-07 04:12发布

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

http://localhost:8080/alfresco/service/api/upload 

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.

Below is my code

<form method="post" name="uploadForm" enctype='multipart/form-data' id="upload_form" action="http://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>

标签: php alfresco
1条回答
来,给爷笑一个
2楼-- · 2019-09-07 04:49

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

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

查看更多
登录 后发表回答