# File Tools

Most of the file commands in Captivate can also take a url parameter to download the file from an online resource.

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/runDbQuery" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/convertToJson" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/fetchUrl" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/downloadImage" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/encodeImage" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/getDirectoryContent" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/getFileContent" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/openDirectoryDialog" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/openFileDialog" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/openUrl" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/QtCUCNFgpSmrzNpGPNiZ" path="/api/command/setFileContent" method="get" %}
[api-spec.yaml](https://2284285836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkMvk0MrY3BcyplZ0pf7%2Fuploads%2Fgit-blob-145f693d93b2e9832afde71a642305186b556f75%2Fapi-spec.yaml?alt=media)
{% endopenapi %}

> Note: The `fetchUrl` command exists to let you perform web requests when your controller is running in a browser context. Browsers have different security models that can sometimes limit your ability to get data from a remote resource.


---

# 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://developers.newbluefx.com/captivate-api/all-commands-reference/file-tools.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.
