Copy file to remote storage

POST

POST requests are used to copy original files or their modified versions to a custom storage.

Source files MAY either be stored or just uploaded and MUST NOT be deleted.

Copying of large files is not supported at the moment. File size MUST NOT exceed 5 GB.

Headers

AcceptstringOptional
Version header.

Request

This endpoint expects an object.
sourcestringRequired
A CDN URL or just UUID of a file subjected to copy.
targetstringRequired
Identifies a custom storage name related to your project. It implies that you are copying a file to a specified custom storage. Keep in mind that you can have multiple storages associated with a single S3 bucket.
make_publicbooleanOptional

MUST be either true or false. The true value makes copied files available via public links, false does the opposite.

patternenumOptionalDefaults to ${default}

The parameter is used to specify file names Uploadcare passes to a custom storage. If the parameter is omitted, your custom storages pattern is used. Use any combination of allowed values.

Parameter values:

  • ${default} = ${uuid}/${auto_filename}
  • ${auto_filename} = ${filename}${effects}${ext}
  • ${effects} = processing operations put into a CDN URL
  • ${filename} = original filename without extension
  • ${uuid} = file UUID
  • ${ext} = file extension, including period, e.g. .jpg

Response

This endpoint returns an object.
typestringOptionalDefaults to url
resultstringOptional
URL with an s3 scheme. Your bucket name is put as a host, and an s3 object path follows.

Errors