> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://uploadcare.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://uploadcare.com/docs/_mcp/server.

# Uploading files with API

> Handle user-generated content and media delivery with Uploadcare — reliable uploads made easy across use cases.

Upload any file type from a variety of sources using Uploadcare's flexible [Upload API](https://uploadcare.com/docs/api/upload/).

Once uploaded, files are:

* Stored in your project's storage.
* Instantly available via [Uploadcare CDN](/docs/delivery/) using secure, unguessable URLs.
* Accessible for further processing or delivery.

Each file belongs to a project: an isolated environment with its own API keys and settings.

## Projects

All files are uploaded into the projects. Projects are separate environments
with unique sets of [API keys](https://app.uploadcare.com/projects/-/api-keys/), dedicated storage, and settings.

For example, projects can be used to separate development, staging, and
production environments. Learn more about [projects](/docs/start/settings/).

## File storing behavior

When uploading files, you can specify whether you want to keep
them permanently or not.

Notice the `UPLOADCARE_STORE` parameter in the example above.
It can be set as follows:

* `0`: the file will be deleted after 24 hours.
* `1`: the file will be stored permanently until explicitly deleted.
* `auto`: defers the choice of storage behavior to the project's
  [auto-store setting](/docs/uploads/storage/#file-storing-behavior) (which is ON by default).

If you don't specify `UPLOADCARE_STORE` parameter, the default value is `auto`.
Note: Before, the value was `0` by default.

Learn more about [storing behavior](/docs/uploads/storage/#file-storing-behavior).

## Billing

Learn how we charge for [uploading operations](/docs/billing/#uploading).

Note: Only image uploads are available on the [Free plan](/docs/billing/#plans-and-limits).
To upload other file types besides images, you will need to add a credit
card to your account for Know Your Customer (KYC) principles, but as long as
you are on the free plan, you will not be charged.

## Request and response

When you upload a file:

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "UPLOADCARE_STORE=auto" \
     -F "file=@sample-file.jpeg" \
     "https://upload.uploadcare.com/base/"
```

#### JavaScript

```js
import { uploadDirect } from '@uploadcare/upload-client'

// fileData must be `Blob` or `File` or `Buffer`
const result = await uploadDirect(
  fileData,
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    store: 'auto',
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$fileInfo = $uploader->fromPath(__DIR__ . '/sample-file.jpeg', null, null);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
with open("sample-file.jpeg", "rb") as file_object:
    ucare_file = uploadcare.upload(file_object)
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_file = File.open('sample-file.jpeg')
uploaded_file = Uploadcare::Uploader.upload(source_file)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

guard let url = Bundle.main.url(forResource: "squirrel", withExtension: "jpg"),
      let data = try? Data(contentsOf: url) else { return }
let file = try await uploadcare.uploadFile(data, withName: "random_file_name.jpg", store: .auto) { progress in
  print("progress: \(progress)")
}
prkint(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
val file = FileUploader(uploadcare, uri = uri, context = context).upload()
Log.d("TAG", file.toString())
```

you immediately receive the file's UUID in a 200 response:

```
{
  "sample-image.jpeg": "17be4678-dab7-4bc7-8753-28914a22960a"
}
```

and the file immediately becomes available on our CDN:

```
https://:subdomain.ucarecd.net/17be4678-dab7-4bc7-8753-28914a22960a/
```

`:subdomain` is your project's subdomain. Find it in [Delivery](https://app.uploadcare.com/projects/-/settings/#delivery).

Save this UUID into your database and retrieve it to:

* Serve optimized and transformed images.
* Encode videos based on their size and codec.
* Organize them with arbitrary metadata and tags.
* Detect the type of content.

Learn more about [Upload API](https://uploadcare.com/docs/api/upload/).

## Upload local file \[#direct-uploads]

The simplest way to upload a local file is to perform a HTTP POST request.
As in the example above, you only need to specify the project's public key.
Direct file uploads support files smaller than 100 MiB only. (If you want
to upload larger files, please use [multipart uploads](#multipart) instead).

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "UPLOADCARE_STORE=auto" \
     -F "file=@sample-file.jpeg" \
     "https://upload.uploadcare.com/base/"
```

#### JavaScript

```js
import { uploadDirect } from '@uploadcare/upload-client'

// fileData must be `Blob` or `File` or `Buffer`
const result = await uploadDirect(
  fileData,
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    store: 'auto',
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$fileInfo = $uploader->fromPath(__DIR__ . '/sample-file.jpeg', null, null);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
with open("sample-file.jpeg", "rb") as file_object:
    ucare_file = uploadcare.upload(file_object)
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_file = File.open('sample-file.jpeg')
uploaded_file = Uploadcare::Uploader.upload(source_file)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

guard let url = Bundle.main.url(forResource: "squirrel", withExtension: "jpg"),
      let data = try? Data(contentsOf: url) else { return }
let file = try await uploadcare.uploadFile(data, withName: "random_file_name.jpg", store: .auto) { progress in
  print("progress: \(progress)")
}
prkint(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
val file = FileUploader(uploadcare, uri = uri, context = context).upload()
Log.d("TAG", file.toString())
```

*Check out detailed API reference for [direct uploads](https://uploadcare.com/docs/api/upload/upload/base-upload).*

## Upload from URL \[#from-url]

Uploadcare can fetch a file from a publicly available URL and upload it to your
project.

#### cURL

```bash
curl -F "pub_key=$YOUR_PUBLIC_KEY" \
     -F "source_url=$URL" \
     "https://upload.uploadcare.com/from_url/"
```

#### JavaScript

```js
import { uploadFromUrl } from '@uploadcare/upload-client'

const result = await uploadFromUrl(
  'https://source.unsplash.com/featured',
  {
    publicKey: 'YOUR_PUBLIC_KEY',
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$url = 'https://source.unsplash.com/featured';
$token = $uploader->fromUrl($url, null, null);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
ucare_file = uploadcare.upload("https://source.unsplash.com/featured")
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_url = "https://source.unsplash.com/featured"
uploaded_file = Uploadcare::Uploader.upload(source_url)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

let url = URL(string: "https://source.unsplash.com/featured")!
let task = UploadFromURLTask(sourceUrl: url)
  .store(.auto)
  .setMetadata("uploader", forKey: "subsystem")
  .setMetadata("cat", forKey: "pet")
let file = try await uploadcare.uploadAPI.uploadAndWaitForCompletion(task: task)
print(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uploader = UrlUploader(
    client = uploadcare,
    sourceUrl = "https://source.unsplash.com/featured"
)
val file = uploader.upload()
Log.d("TAG", file.toString())
```

*Check out detailed [uploads from URL](https://uploadcare.com/docs/api/upload/upload/from-url-upload) API reference.*

Requests to the endpoint return a JSON dictionary with a token that can be
further used to check the status of an upload request. The token is not a
file ID and can't be used to address the file directly. The actual file ID
should be retrieved by calling the `/from_url/status/` endpoint.
Integration implementation may vary, please refer to the respective documentation.

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "token=$token" \
     "https://upload.uploadcare.com/from_url/status/"
```

#### JavaScript

```js
import { fromUrlStatus } from '@uploadcare/upload-client'

const result = await fromUrlStatus(
  'token',
  {
    publicKey: 'YOUR_PUBLIC_KEY'
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$status = $uploader->checkStatus('token');
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
ucare_file = uploadcare.upload_from_url_sync(

    check_duplicates=True,
    save_duplicates=False
)
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

token = 'token'
status = Uploadcare::Uploader.get_upload_from_url_status(token)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

let status = try await uploadcare.uploadAPI.uploadStatus(forToken: "token")
print(status)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val status = uploadcare.getFromUrlStatus(token = "945ebb27-1fd6-46c6-a859-b9893712d650")
Log.d("TAG", status.toString())
```

*Check out detailed API reference for [uploads from URL](https://uploadcare.com/docs/api/upload/upload/from-url-upload-status).*

## Duplicates prevention

By default, every request to the `/from_url/` endpoint with the same
`source_url` results in a new upload leading to file duplication.

If you would like Uploadcare to keep track of the requested URLs and avoid
duplicate uploads, pass the `save_URL_duplicates` and `check_URL_duplicates`
parameters described in [uploads from URL](https://uploadcare.com/docs/api/upload/upload/from-url-upload) API reference.

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "check_URL_duplicates=1" \
     -F "source_url=$URL" \
     "https://upload.uploadcare.com/from_url/"
```

#### JavaScript

```js
import { uploadFromUrl } from '@uploadcare/upload-client'

const result = await uploadFromUrl(
  'https://source.unsplash.com/featured',
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    checkForUrlDuplicates: 1,
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$url = 'https://source.unsplash.com/featured';
$token = $uploader->fromUrl($url, null, null, [
    'checkDuplicates' => true,
]);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
ucare_file = uploadcare.upload("https://source.unsplash.com/featured")
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_url = "https://source.unsplash.com/featured"
uploaded_file = Uploadcare::Uploader.upload(
  source_url, check_URL_duplicates: 1
)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

let url = URL(string: "https://source.unsplash.com/featured")!
let task = UploadFromURLTask(sourceUrl: url)
  .store(.auto)
  .setMetadata("uploader", forKey: "subsystem")
  .setMetadata("cat", forKey: "pet")
task1.checkURLDuplicates = true
let file = try await uploadcare.uploadAPI.uploadAndWaitForCompletion(task: task)
print(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uploader = UrlUploader(
    client = uploadcare,
    sourceUrl = "https://source.unsplash.com/featured"
)
val file = uploader.upload()
Log.d("TAG", file.toString())
```

If the `source_url` had already been fetched and uploaded previously, this
request would return information about the already uploaded file.

## Upload large file \[#multipart]

Multipart uploads should be used if you need to upload files larger
than 100 MiB or if you want to explicitly trigger
[AWS S3 Transfer Acceleration](https://aws.amazon.com/s3/transfer-acceleration/).

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "filename=large-file.mp4" \
     -F "size=27796904" \
     -F "content_type=video/mp4" \
     "https://upload.uploadcare.com/multipart/start/"

curl -X PUT "<presigned-url-part-from-multipart-start>"
     -H "Content-Type: application/octet-stream" --data <data-part>

curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "uuid=$UUID" \
     "https://upload.uploadcare.com/multipart/complete/"
```

#### JavaScript

```js
import { uploadMultipart } from '@uploadcare/upload-client'

// fileData must be `Blob` or `File` or `Buffer`
const result = await uploadMultipart(
  fileData,
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    store: 'auto',
    fileName: 'large-file.mp4',
    contentType: 'video/mp4',
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$path = '/large-file.zip';
$handle = \fopen($path, 'rb');
$response = $uploader->fromResource($handle, null, null);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
with open("large-file.mp4", "rb") as file_object:
    ucare_file = uploadcare.upload(file_object)
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_file = File.open('large-file.mp4')
uploaded_file = Uploadcare::Uploader.upload(source_file)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

guard let url = Bundle.main.url(forResource: "myfile", withExtension: "jpg"),
      let data = try? Data(contentsOf: url) else { return }
let metadata = ["subsystem": "uploader", "pet": "cat"]
let onProgress: (Double)->Void = { (progress) in
  print("progress: \(progress)")
}
let file = try await uploadcare.uploadAPI.multipartUpload(data, withName: "myfile_big.jpg", store: .auto, metadata: metadata, onProgress)
print(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
val file = FileUploader(uploadcare, uri = uri, context = context).upload()
Log.d("TAG", file.toString())
```

*Check out detailed API reference for [multipart uploads](https://uploadcare.com/docs/api/upload/upload/multipart-file-upload-start).*

Note: Each uploaded part should be at least 5242880 bytes in size except
for the last one, which can be smaller. You can upload the file parts
in parallel, provided that the byte order stays unchanged.

## Add arbitrary metadata \[#metadata]

You can add additional, arbitrary key-value data associated with uploaded files.
For example, you could store user IDs or order IDs.

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "file=@sample-image.jpeg" \
     -F "metadata[userId]=1" \
     -F "metadata[type]=avatar" \
     "https://upload.uploadcare.com/base/"
```

#### JavaScript

```js
import { uploadDirect } from '@uploadcare/upload-client'

// fileData must be `Blob` or `File` or `Buffer`
const result = await uploadDirect(
  fileData,
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    store: 'auto',
    metadata: {
      userID: '1',
      type: 'avatar'
    }
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$fileInfo = $uploader->fromPath(__DIR__ . '/sample-image.jpeg', null, null, [
    'userId' => '1',
    'type' => 'avatar',
]);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
with open("sample-image.jpeg", "rb") as file_object:
    ucare_file = uploadcare.upload(
        file_object,
        metadata={
            "userId": "1",
            "type": "avatar",
        },
    )
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_file = File.open('sample-image.jpeg')
uploaded_file = Uploadcare::Uploader.upload(
  source_file, metadata: { userId: 1, type: :avatar }
)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

guard let url = Bundle.main.url(forResource: "squirrel", withExtension: "jpg"),
      let data = try? Data(contentsOf: url) else { return }
let metadata = ["subsystem": "uploader", "pet": "cat"]
let file = try await uploadcare.uploadFile(data, withName: "random_file_name.jpg", store: .auto) { progress in
  print("progress: \(progress)")
}
prkint(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
val file = FileUploader(uploadcare, uri = uri, context = context).upload()
Log.d("TAG", file.toString())
```

Learn more about [file metadata](/docs/file-metadata/).

## Add tags \[#tags]

You can attach an ordered list of string tags to a file at upload time.
Tags are passed as a comma-separated string and normalized before storage.

#### cURL

```bash
curl -F "UPLOADCARE_PUB_KEY=$YOUR_PUBLIC_KEY" \
     -F "file=@sample-image.jpeg" \
     -F "tags=cat,animal,cute" \
     "https://upload.uploadcare.com/base/"
```

#### JavaScript

```js
import { uploadDirect } from '@uploadcare/upload-client'

// fileData must be `Blob` or `File` or `Buffer`
const result = await uploadDirect(
  fileData,
  {
    publicKey: 'YOUR_PUBLIC_KEY',
    store: 'auto',
    tags: ['cat', 'animal', 'cute']
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$uploader = new Uploadcare\Uploader\Uploader($configuration);
$fileInfo = $uploader->fromPath(__DIR__ . '/sample-image.jpeg', null, null, [], ['cat', 'animal', 'cute']);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
with open("sample-image.jpeg", "rb") as file_object:
    ucare_file = uploadcare.upload(
        file_object,
        tags=["cat", "animal", "cute"],
    )
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

source_file = File.open('sample-image.jpeg')
uploaded_file = Uploadcare::Uploader.upload(
  source_file, tags: ['cat', 'animal', 'cute']
)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

guard let url = Bundle.main.url(forResource: "squirrel", withExtension: "jpg"),
      let data = try? Data(contentsOf: url) else { return }
let tags = ["cat", "animal", "cute"]
let file = try await uploadcare.uploadFile(data, withName: "random_file_name.jpg", store: .auto, tags: tags) { progress in
  print("progress: \(progress)")
}
print(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
val file = FileUploader(uploadcare, uri = uri, context = context)
    .tags(listOf("cat", "animal", "cute"))
    .upload()
Log.d("TAG", file.toString())
```

Learn more about [file tags](/docs/file-tags/).

## Get file info \[#file-info]

There're various methods to get file information: via
[Upload API file info](https://uploadcare.com/docs/api/upload/upload/file-upload-info),
[REST API file info](https://uploadcare.com/docs/api/rest/file/info), or [URL API file info](https://uploadcare.com/docs/api/url/file-information/file-info-json).
Upload API gives you limited but essential access, while REST API gives full details.
Integration implementation may vary, please refer to the respective documentation.

#### cURL

```bash
curl -F "pub_key=$YOUR_PUBLIC_KEY" \
     -F "file_id=$UUID" \
     "https://upload.uploadcare.com/info/"
```

#### JavaScript

```js
import { info } from '@uploadcare/upload-client'

const result = await info(
  'UUID',
  {
    publicKey: 'YOUR_PUBLIC_KEY'
  }
)
```

#### PHP

```php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);
$fileInfo = (new Uploadcare\Api($configuration))->file()->fileInfo(string $uuid);
```

#### Python

```python
from pyuploadcare import Uploadcare

uploadcare = Uploadcare(public_key="YOUR_PUBLIC_KEY", secret_key="YOUR_SECRET_KEY")
ucare_file = uploadcare.file("UUID")
file_info = ucare_file.info
```

#### Ruby

```ruby
require 'uploadcare'
Uploadcare.config.public_key = "YOUR_PUBLIC_KEY"

uuid = 'UUID'
Uploadcare::Uploader.file_info(uuid)
```

#### Swift

```swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

let file = try await uploadcare.uploadAPI.fileInfo(withFileId: "UUID")
print(file)
```

#### Kotlin

```kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

val file = uploadcare.getUploadedFile(fileId = "740e1b8c-1ad8-4324-b7ec-112c79d8eac2")
Log.d("TAG", file.toString())
```

*Check out detailed API reference for [file info](https://uploadcare.com/docs/api/upload/upload/file-upload-info).*

## Remote uploading method

You can upload remote files on the fly with [Proxy](/docs/delivery/proxy/).

Proxy automatically retrieves files from existing remote locations and delivers
them using [Uploadcare CDN](/docs/delivery/).
It's easy to integrate, requiring only one URL modification:

```
https://endpoint.ucr.io/ + https://yoursite.com/assets/image.jpg =
https://endpoint.ucr.io/https://yoursite.com/assets/image.jpg
```