> For the complete documentation index, see [llms.txt](https://docs.redutzu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redutzu.com/resources/redutzu-mdt/guides/images.md).

# Images

## Upload Configuration Explanation

The `Upload` configuration allows you to set up image uploading for your MDT system. You can choose between different upload methods: Discord, Imgur, FiveManage, or a custom solution.

### Main Configuration

```lua
Upload = {}
Upload.Method = 'fivemanage'  -- Options: 'discord', 'imgur', 'fivemanage', 'custom'
```

`Upload.Method` specifies which upload service to use. Set this to one of the available options.

### Upload Methods Configuration

Each upload method has its own configuration:

```lua
Upload.Methods = {
    ['discord'] = { ... },
    ['imgur'] = { ... },
    ['fivemanage'] = { ... },
    ['custom'] = { ... }
}
```

#### Discord Upload

```lua
['discord'] = {
    link = 'https://discord.com/api/webhooks/',  -- Your webhook link
    field = 'files[]',
    path = 'attachments.1.url',
    options = {
        encoding = 'webp'  -- Options: 'webp', 'png', 'jpg'
    }
}
```

To set up Discord uploading:

1. Create a webhook in your Discord server.
2. Replace `'https://discord.com/api/webhooks/'` with your full webhook URL.
3. Choose an encoding format ('webp' for smaller file sizes, or 'png'/'jpg' for different formats).

Example:

```lua
['discord'] = {
    link = 'https://discord.com/api/webhooks/123456789/abcdefghijklmnop',
    field = 'files[]',
    path = 'attachments.1.url',
    options = {
        encoding = 'png'
    }
}
```

#### Imgur Upload

```lua
['imgur'] = {
    link = 'https://api.imgur.com/3/upload',
    field = 'image',
    path = 'data.link',
    options = {
        headers = {
            ['Authorization'] = 'Client-ID YOUR_KEY_HERE'  -- Add your client id
        }
    }
}
```

To set up Imgur uploading:

1. Create an Imgur account and register an application to get a Client ID.
2. Replace `'YOUR_KEY_HERE'` with your Imgur Client ID.

Example:

```lua
['imgur'] = {
    link = 'https://api.imgur.com/3/upload',
    field = 'image',
    path = 'data.link',
    options = {
        headers = {
            ['Authorization'] = 'Client-ID a1b2c3d4e5f6g7h'
        }
    }
}
```

#### FiveManage Upload

```lua
['fivemanage'] = {
    link = 'https://api.fivemanage.com/api/image',
    field = 'image',
    path = 'url',
    options = {
        encoding = 'png',
        headers = {
            ['Authorization'] = 'YOUR_KEY_HERE'
        }
    }
}
```

To set up FiveManage uploading:

1. Obtain an API key from FiveManage.
2. Replace `'YOUR_KEY_HERE'` with your FiveManage API key.
3. Optionally, change the `encoding` if needed.

Example:

```lua
['fivemanage'] = {
    link = 'https://api.fivemanage.com/api/image',
    field = 'image',
    path = 'url',
    options = {
        encoding = 'webp',
        headers = {
            ['Authorization'] = 'fm_api_key_123456789abcdef'
        }
    }
}
```

#### Custom Upload

```lua
['custom'] = {
    link = 'https://api.your_website.com/api',  -- Your API link
    field = 'file',
    path = 'link',
    options = {
        headers = {
            ['Authorization'] = 'Key YOUR_KEY_HERE'
        }
    }
}
```

To set up a custom upload solution:

1. Replace `'https://api.your_website.com/api'` with your custom API endpoint.
2. Adjust the `field` and `path` values to match your API's requirements.
3. Add any necessary headers, including authorization if required.

Example:

```lua
['custom'] = {
    link = 'https://imageupload.myserver.com/upload',
    field = 'image_data',
    path = 'response.image_url',
    options = {
        headers = {
            ['Authorization'] = 'Key myserver_secret_key_123',
            ['Content-Type'] = 'application/json'
        }
    }
}
```

Remember to choose your preferred upload method by setting `Upload.Method` to the corresponding key ('discord', 'imgur', 'fivemanage', or 'custom') and properly configure that method's settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.redutzu.com/resources/redutzu-mdt/guides/images.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
