Measurable Success «10 Checkpoints for Future-Proof Enterprise CMS» White Paper
Measurable Success - White Paper


Prepares the Binary instance for copying.

Note: This does not perform the actual copying but returns a FutureBinary. The actual copying can be triggered by putting the FutureBinary into an Obj.


  • options (optional) (Object) - Options to pass when copying a Binary:
    • filename (String) - The new file name.
    • contentType (String) - A content type for overriding the original contentType.


  • ArgumentError - If any of the passed-in options are blank.




Create a copy of a random image. This involves three steps, creating the new image object, copying the blob of the source image, and placing this copy into the new object.

i = Scrivito.getClass("Image").create({ })
blob = Scrivito.getClass("Image").all().first().get("blob")
futureBinary = blob.copy()
futureBinary.into(i).then(copiedBinary => i.update({ blob: copiedBinary }))