Search code examples
restapimetadataalfresco

How to upload a folder and subfolders within documents using Alfresco Rest API?


I want to upload a folder that contains many subfolders, those subfolders contains also many documents, into alfresco repository. I did this with Bulk Import Tool using for each folder/document an xml metadata file for importing also their properties. But to do this I must generate for each an xml file containing the metadata. So I search for an alternative solution and I found that I can do this with Alfresco Rest API calls without that xml metadata file. But I really don't know how to use it for upload.

Please if someone can help me with that. Thanks a lot.


Solution

  • If you can get your files moved to the same server where Alfresco is running, using the Bulk File System Import Tool (BFSIT) is likely going to be the best import approach in terms of performance, even if you have to create the XML manifest files that describe the metadata that accompanies each file you are importing.

    If that approach does not meet your needs you can use a variety of alternatives to do the import. That includes:

    1. Writing a client that leverages CMIS using Java, Python, .NET, or any other languages for which you can find a CMIS client library. Apache Chemistry has several, but there are others out there.

    2. Using the client-side JavaScript API that is shipped as part of ADF.

    3. Using the Alfresco public REST API. Prior to Alfresco 5.2, the "Alfresco API" was a mix of CMIS and Alfresco-specific REST calls that handled things the CMIS API did not cover. With 5.2 there is a new set of RESTful endpoints that can be used for all sorts of things, including creating nodes.

    Defintely recommend taking a look at the API Explorer to see the Swagger doc on the API.