into(target)

This performs the actual upload or copy operation and stores the FutureBinary instance in the specified Obj.

Params

  • target (Obj) - The CMS object to which the binary should be uploaded

Returns

Promise<Binary>

Example

Create an image object and upload an image file into it.

Copy
image = Scrivito.getClass("Image").create({ })
futureBinary = Scrivito.Binary.upload(myLocalFile)
futureBinary.into(image).then(binary => image.update({ blob: binary }))