Image copied to a remote storage without effects

Hello:
I want to copy to a remote storage (S3 Bucket) an image with effects using NodeJS. I am using this piece of code:

import { copyFileToRemoteStorage, UploadcareSimpleAuthSchema } from “@uploadcare/rest-client”;

const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: “MYPUBLIC_KEY”,
secretKey: "MYSECRET_KEY,
});

const result = await copyFileToRemoteStorage(
    {
      source: '1afad717-65c7-41e9-9815-55430856bbcd',
      target: 'AWS-S3-mytestbucket',
      pattern: '${uuid}${effects}${ext}',
    },
    { authSchema: uploadcareSimpleAuthSchema }
  )

The image is copied to the bucked but with no effects (rotation, color, etc.). I have tried all the combinations of the “pattern” parameters with no luck.

Any help would be greatly appreciated.

Warm Regards!

Hi @ramon,

If you want to apply transformations upon copying an image, you need to specify the transformations in the source parameter. For example:

const result = await copyFileToRemoteStorage(
    {
      source: '1afad717-65c7-41e9-9815-55430856bbcd/-/resize/300x/-/blur/50/',
      target: 'AWS-S3-mytestbucket',
      pattern: '${uuid}${effects}${ext}',
    },
    { authSchema: uploadcareSimpleAuthSchema }
  )

ohh… Great!!

Many thanks, Alex!