Test your website performance for free
Test your website performance

copy(options)

Prepares the Binary instance for copying. Returns a FutureBinary.

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

Params

  • 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.

Throws

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

Returns

FutureBinary

Examples

Rename an image. The blob of the source binary is copied into a FutureBinary instance to which the new filename is passed as an option. Then, the FutureBinary is copied back into the source.

Transfer the blob of an image from an attribute to a different one, and empty the old attribute.