The Cloud CMS Bulk Import tool makes it easy to import content from a file system into a Cloud CMS content repository.

Let's imagine that you have some images sitting in an images directory. You wish to ingest these into Cloud CMS as part of an Image Library application.

The image directory might look like this:


These images are just files on disk. They could be any file type, really. Cloud CMS can ingest files of any format including popular desktop formats like Microsoft Office and Adobe PDF as well as audio and video formats.

We can import these images into Cloud CMS by using the cloudcms-packager module like this:

var walk = require("fs-walk");
var fs = require("fs");
var path = require("path");

// create a packager
var PackagerFactory = require("cloudcms-packager");
PackagerFactory.create(function(err, packager) {

    // Create a content type for images
    var contentTypeObject = {
        "title": "Image",
        "type": "object",
        "properties": {
            "title": {
                "title": "Title",
                "type": "string"
        "_qname": "my:image",
        "_type": "d:type",
        "_parent": "n:node"


    var imageCount = 0;
    walk.walkSync("./images", function(basedir, filename, stat) {

        var alias = "image-" + (imageCount++);
        var obj = {
            "title": filename,
            "_alias": alias,
            "_type": "my:image"

        packager.addAttachment(alias, "default", path.join(basedir, filename));

    // commit
    packager.package(function(err, archiveInfo) {
        console.log("Wrote archive: " + archiveInfo.filename);

For a full example of this code in action, please see: