# finalizeFileUpload

Audience: Developer

Finalize a file upload by reading the actual size from object storage and persisting it on the File record.

Finalize a file upload by reading the actual size from object storage and
persisting it on the File record. Call this after the client has successfully
uploaded bytes to the pre-signed URL returned by createFile.

**Served by:** [file](https://docs.pyck.cloud/dev/api/services/file.md)

## Arguments

| Name | Type |
| --- | --- |
| `id` | ID! |

## Returns

[File](https://docs.pyck.cloud/dev/api/types/file.md)!

## Example

Reads the actual size of an uploaded file from object storage and stores it on the File record. Call it after the bytes were uploaded to the pre-signed URL that createFile returned.

```graphql
mutation FinalizeFileUpload($id: ID!) {
  finalizeFileUpload(id: $id) {
    contentType
    createdAt
    createdBy
    data
    dataTypeID
    dataTypeSlug
    deletedAt
    deletedBy
    description
    id
    name
    publicAlias
    publicURL
    refid
    reftype
    size
    tenantID
    updatedAt
    updatedBy
    url
  }
}
```

**Variables**

```json
{
  "id": "<file ID>"
}
```
