For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
GuidesIntegrationsAPI ReferencesRelease notes
GuidesIntegrationsAPI ReferencesRelease notes
  • Introduction
    • Overview
    • Quick Start
    • Projects
    • Billing
  • Uploading
    • Overview
    • Uploading files with API
    • File analysis on upload
  • Optimization
    • Overview
  • Transformations
      • Overview
      • Resize, crop, rotation
      • Overlays and watermarks
      • Effects and enhancements
      • Face-detection based transformations
      • SVG transformations
      • Background removal
      • Baked transformations
      • Object recognition
  • Delivery
    • Overview
    • On-the-fly operations
    • CDN settings
    • Proxy
  • Security
    • Overview
    • Validation and moderation
    • Signed uploads
    • Signed URLs
    • Unsafe content moderation
    • Malware protection
    • HIPAA workflows
  • Storage
    • Uploadcare storage
    • Cloudflare R2
    • Google Cloud Storage
    • Azure Blob Storage
  • File management
    • Overview
    • Managing files
    • File groups
    • Webhooks
    • Arbitrary file metadata
  • CLI
    • Overview
    • Configuration
  • Migration
    • Migration to Uploadcare
    • Migration from Filestack
Dashboard
LogoLogo
On this page
  • Signed URLs
  • Re-upload a new version
  • Create a copy
  • API integrations
TransformationsImage

Securing image files from reverting applied operations

Was this page helpful?
Previous

Object recognition

Next
Built with

Uploadcare enables you to safeguard your images and photos from unauthorized editing and misuse.

When you apply our on-the-fly image processing operations (e.g. crop, blur faces or add a watermark), you do so by modifying its URL. Unfortunately, some users can remove those parameters and regain access to the original image.

You can “bake” a URL with operations applied to an image by saving a processed image version as a separate file. There are 3 ways to do this.

To prevent this, you can “bake” a URL with the operations applied to an image by saving a processed image version as a separate file or by signing existing URLs. There are three ways to do this.

Signed URLs

The best way to protect URLs from modification is to use signed URLs. Just set the very long validity period (e.g., several years).

This method doesn’t affect your storage volume and upload units. You can monitor usage in the project’s Dashboard.

Re-upload a new version

Use Upload API from_URL method:

$curl -L -X POST 'https://upload.uploadcare.com/from_url/' \
> -F "pub_key=$YOUR_PUBLIC_KEY" \
> -F "source_url=https://$SUBDOMAIN.ucarecd.net/$UUID/-/operation/:param/"

Where:

  • $YOUR_PUBLIC_KEY — get from API keys.
  • $SUBDOMAIN — your project’s subdomain — find it in Delivery.
  • $UUID — UUID of original image.
  • -/operation/:param/ — the name of the image processing operation with parameters (if necessary), that you want to bake in.

The response will contain a token:

{
"type": "token",
"token": "945ebb27-1fd6-46c6-a859-b9893712d650"
}

The actual file UUID should be retrieved by calling the /from_url/status/ endpoint.

Create a copy

Use REST API local_copy operation:

$curl -L -X POST 'https://api.uploadcare.com/files/local_copy/' \
> -H "Accept: application/vnd.uploadcare-v0.7+json" \
> -H "Authorization: Uploadcare.Simple $YOUR_PUBLIC_KEY:$YOUR_SECRET_KEY" \
> -F "source=$UUID/-/operation/:param/"

Where:

  • $YOUR_PUBLIC_KEY and $YOUR_SECRET_KEY — get them from API keys.
  • $UUID — UUID of original image.
  • -/{operation}/{param}/ — image processing operations that you need to bake in.

As a result, the processed version will be saved in the same project as a separate file, which you can safely use in your application. The URL has changed; it only contains a newly assigned UUID; no operations are present.

API integrations

You don’t have to code most of the low-level API integrations. We have high-level libraries for all popular platforms:

  • JavaScript
  • PHP
  • Python & Django
  • Ruby
  • Rails
  • Java
  • Golang
  • Rust
  • Swift
  • Android

Copying via from_url can be safely done on the front end using client-side JS libraries.