# Upload File to Deployment

{% hint style="info" %}
This feature is currently only available through the [API](/docs/api.md).
{% endhint %}

It is possible to upload files from your S3 bucket to your deployment. Since the files are only downloaded when a deployment is created, you can modify the files in your bucket and see the changes in the next deployment you create.

### Pull profiles

Pull profiles define what files or folders should be downloaded from your S3 bucket and where to save them in your deployment.

Before creating a pull profile, ensure you have at least one [Endpoint Storage](/docs/endpoint-storage.md) configured.

You will then want to create a pull profile within this bucket with the following information:

* The **name** of the pull profile: This will be used to associate the pull profile to your app versions later on, so it should be unique and descriptive.
* The **source** path: The path to the file or folder in your S3 bucket. It should start with a slash, and its root is the root of your bucket.
* The **source\_type**: This can be either "file" or "folder" and must be set correctly for the download to succeed.
* The **destination** path: The path in your deployment where the file or folder will be saved. It should start with a slash, and its root is the root of your container image.

{% hint style="warning" %}
Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment and will make your deployment fail. Make sure a normal user can write to the destination folder.
{% endhint %}

For example, if you wanted to copy the file `some-file.txt`, from your bucket, to the `custom-folder` folder in your deployment, with both file structures as described below:

```
s3://my-bucket/
├─ some-folder/
│  ├─ some-file.txt
├─ some-other-folder/
│  ├─ some-other-file.jpg
```

```
/
├─ app/
│  ├─ entrypoint.sh
│  ├─ custom-folder/

```

You would create your pull profile with the following information:

```json
{
  "name": "some-file-pull-profile",
  "source": "/some-folder/some-file.txt",
  "source_type": "file",
  "destination": "/app/custom-folder/"
}
```

For more details, [see the API documentation](/docs/api.md).

### Linking a pull profile to an app version

After creating a pull profile, you must link an app version to it, so the files are downloaded when a deployment is created. That way, you can use multiple pull profiles for a single app version and reuse pull profiles between app versions.

[See the API documentation](/docs/api.md)

### Limitations

The total size of the files downloaded to the deployment cannot exceed 5 MB.

If this limit is reached, you will be notified at deployment time so that you can promptly resolve the issue.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgegap.com/docs/endpoint-storage/upload-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
