**Source URL:** https://limited.veevavault.dev/qualityone/vault-api/api-reference/19.1/metadata-definition-language-mdl/components-with-content/upload-content-file.md

# Upload Content File

This endpoint allows you to upload a content file to be referenced by a component.

Once uploaded, Vault stores the file in a generic files staging area where they will remain until referenced by a component. Once referenced, Vault cannot access the named file from the staging area.

<Endpoint path="/api/mdl/files" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Content-Type` | `multipart/form-data` (default) or `application/x-www-form-urlencoded` |
| `Accept` | `application/json` (default) or `application/xml` |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F 'file=@C:\Quote.pdf'
https://myvault.veevavault.com/api/mdl/files

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
  "responseStatus": "SUCCESS",
  "data": {
      "name__v": "4be398c32fc2ccf48adaf6ebe53782a1",
      "format__v": "application/pdf",
      "size__v": 4716,
      "sha1_checksum__v": "4be398c32fc2ccf48adaf6ebe53782a1"
         }
    }

```
</CodeExample>

## Example Body: Reference Named File {#example-body-reference-named-file}

<CodeExample title="">
```
RECREATE Formattedoutput my_formatted_output__c (
    label(‘My Formatted Output’),
    active(true),
    root_object('Object.product__v'),
    root_object_type('Objecttype.product__v.base__v'),
    output_type('native'),
    template('4be398c32fc2ccf48adaf6ebe53782a1')
);

```
</CodeExample>

## Response Details {#response-details}

On SUCCESS, the response includes the following:

<FieldTable>
| Name | Description |
| --- | --- |
| `name__v` | The name of the file which can be used in MDL for referencing the component. |
| `format__v` | The format of the file. |
| `size__v` | The file size of the file. |
| `sha1_checksum__v` | The SHA-1 checksum value generated for the file. Use the checksum to ensure the file was transmitted correctly. |
</FieldTable>

## Referencing Files {#referencing-files}

After uploading a content file, you can reference the file by name using the `file` or `template` attributes in your MDL statement. This example uses the `template` attribute.

To change a component file, you must first upload it and update the component to reference the new file.



---

**Previous:** [Components with Content](/qualityone/vault-api/api-reference/19.1/metadata-definition-language-mdl/components-with-content)  
**Next:** [Retrieve Content File](/qualityone/vault-api/api-reference/19.1/metadata-definition-language-mdl/components-with-content/retrieve-content-file)