Reference · Files

# GET/file/{dirId}/{fileName}

Returns an uploaded file’s path, type and size. Use it to check that an upload arrived.

## Parameters

Parameters

- `dirId` (string): The directory’s id.
- `fileName` (string): The file’s name, URL-encoded if it holds characters a path can’t.

## Request body

This request has no body.

## Example

Request

```bash
curl https://media.logicboostkit.com/file/dir_pi23jgy1yxlmigi873bz/source.mp4 \
  -H "Authorization: Basic $MEDIA_KEY"
```

Response

```http
HTTP/1.1 200 OK
X-Request-Id: job_0mv6hnzdy93wuugau1rys4cn

{
  "ok": true,
  "file_info": {
    "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4",
    "file_type": "video/mp4",
    "file_size": 1937244979
  }
}
```

## Response fields

Response fields

- `ok` (boolean): true when the file exists.
- `file_info.file_path` (string): dir_id/file_name.
- `file_info.file_type` (string | null): The file’s MIME type, from its extension; failing that, the `Content-Type` it was uploaded with; otherwise `null`.
- `file_info.file_size` (number): The file’s size in bytes.

## Status codes

Status codes

- **200**: The file exists. Not charged.
- **401**: The `Authorization` header is missing, or the key is invalid, revoked or expired.
- **403**: The account isn’t active. The error says what to do.
- **404**: `File not found`: the file or its directory isn’t in your account, the directory has expired, or nothing has been uploaded under that name yet.
- **429**: More than 300 requests in a minute on this key. Wait for the number of seconds in `Retry-After`.

Every error has the shape `{"ok": false, "error": "…"}` and is never charged.
