php - Alfresco:: How to add custom properties during file upload using REST api -
while uploading file, using below api.
http://localhost:8080/alfresco/service/api/upload
file getting uploaded in alfresco repository. requirement is, if want add together custom properties custom1, custom2, custom3, custom4 etc please give solution using browser api/ajax call.
below 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>
please read this tutorial on custom content properties can understand how define properties in content model.
then can utilize alfresco rest api, or preferably, cmis api update properties.
php alfresco
No comments:
Post a Comment