Skip to content

Uploading

Srdjan Djenader edited this page Dec 4, 2017 · 1 revision

Specifies how ImagerJs will upload its data.


Enabling the Save Plugin

plugins: [
    'Save'
]

Configuration

pluginsConfig: {
    Save: {
        upload: true,
        uploadFunction: function (imageId, imageData, callback) {
          // Here should be the code to upload image somewhere
          // to Azure, Amazon S3 or similar. When upload completes we will have
          // the url of uploaded image. Then call the function callback(image_url)
          // to notify ImagerJs that image has been uploaded to the server
          callback('http://upload.server.com/image.jpg');
        }
    }
}