Params
target
(Obj
) - The CMS object to which the binary should be uploaded
Returns
Promise<Binary>
This performs the actual upload or copy operation and stores the FutureBinary
instance in the specified Obj
.
Example
Create an image object and upload an image file into it.
image = Scrivito.getClass("Image").create({ })
futureBinary = Scrivito.Binary.upload(myLocalFile)
futureBinary.into(image).then(binary => image.update({ blob: binary }))