> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.slack.files.UploadFileToUser

- Component: `appmixer.slack.files.UploadFileToUser`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.slack 6.0.7](https://connectors.appmixer.com/connector/appmixer.slack/6.0.7.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.slack/6.0.7/component/appmixer.slack.files.UploadFileToUser>

Upload a new file to a direct message or multi-person direct message.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Users (`userIds`) | multiselect | Add up to 8 users to send the message to. |
| File ID (`fileId`) | filepicker | Select an existing file to upload. Or provide File ID of the file you want to upload. |
| Filename (`filename`) | text | Name of the file being uploaded. If omitted, the original filename will be used instead. |
| Alternative Text (`altTxt`) | text | Description of image for screen-reader. Example: 'Aerial view of the Bixby Bridge and coastline of the Big Sur area in California.' |
| Initial Comment (`initialComment`) | text | The message text introducing the file in specified channel. |
| Snippet Type (`snippetType`) | text | Syntax type of the snippet being uploaded. Example: python. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Slack File ID (`id`) | string | - |
| Created (`created`) | number | - |
| Timestamp (`timestamp`) | number | - |
| Name (`name`) | string | - |
| Title (`title`) | string | - |
| MIME Type (`mimetype`) | string | - |
| File Type (`filetype`) | string | - |
| Pretty Type (`pretty_type`) | string | - |
| User (`user`) | string | - |
| User Team (`user_team`) | string | - |
| Editable (`editable`) | boolean | - |
| Size (`size`) | number | - |
| Mode (`mode`) | string | - |
| Is External (`is_external`) | boolean | - |
| External Type (`external_type`) | string | - |
| Is Public (`is_public`) | boolean | - |
| Public URL Shared (`public_url_shared`) | boolean | - |
| Display As Bot (`display_as_bot`) | boolean | - |
| Username (`username`) | string | - |
| URL Private (`url_private`) | string | - |
| URL Private Download (`url_private_download`) | string | - |
| Media Display Type (`media_display_type`) | string | - |
| Permalink (`permalink`) | string | - |
| Permalink Public (`permalink_public`) | string | - |
| Comments Count (`comments_count`) | number | - |
| Is Starred (`is_starred`) | boolean | - |
| Shares (`shares`) | object | - |
| Channels (`channels`) | array | - |
| Groups (`groups`) | array | - |
| IMS (`ims`) | array | - |
| Has More Shares (`has_more_shares`) | boolean | - |
| Has Rich Preview (`has_rich_preview`) | boolean | - |
| File Access (`file_access`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.slack.files.UploadFileToUser",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Upload a new file to a direct message or multi-person direct message.",
  "version": "1.0.0",
  "private": false,
  "auth": {
    "service": "appmixer:slack",
    "scope": [
      "files:write"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "userIds": {},
          "fileId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "altTxt": {
            "type": "string"
          },
          "initialComment": {
            "type": "string"
          },
          "snippetType": {
            "type": "string"
          }
        },
        "required": [
          "userIds",
          "fileId"
        ]
      },
      "inspector": {
        "inputs": {
          "userIds": {
            "type": "multiselect",
            "label": "Users",
            "tooltip": "Add up to 8 users to send the message to.",
            "index": 1,
            "source": {
              "url": "/component/appmixer/slack/list/ListUsers?outPort=out",
              "data": {
                "transform": "./transformers#usersToSelectArray",
                "messages": {
                  "in/outputType": "array",
                  "in/isSource": true
                }
              }
            }
          },
          "fileId": {
            "type": "filepicker",
            "index": 2,
            "label": "File ID",
            "tooltip": "Select an existing file to upload. Or provide File ID of the file you want to upload."
          },
          "filename": {
            "type": "text",
            "index": 3,
            "label": "Filename",
            "tooltip": "Name of the file being uploaded. If omitted, the original filename will be used instead."
          },
          "altTxt": {
            "type": "text",
            "index": 4,
            "label": "Alternative Text",
            "tooltip": "Description of image for screen-reader. Example: 'Aerial view of the Bixby Bridge and coastline of the Big Sur area in California.'"
          },
          "initialComment": {
            "type": "text",
            "index": 5,
            "label": "Initial Comment",
            "tooltip": "The message text introducing the file in specified channel."
          },
          "snippetType": {
            "type": "text",
            "index": 6,
            "label": "Snippet Type",
            "tooltip": "Syntax type of the snippet being uploaded. Example: python."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Slack File ID",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "F07GHI11223"
          }
        },
        {
          "label": "Created",
          "value": "created",
          "schema": {
            "type": "number",
            "example": 1737024600
          }
        },
        {
          "label": "Timestamp",
          "value": "timestamp",
          "schema": {
            "type": "number",
            "example": 1737024600
          }
        },
        {
          "label": "Name",
          "value": "name",
          "schema": {
            "type": "string",
            "example": "screenshot.png"
          }
        },
        {
          "label": "Title",
          "value": "title",
          "schema": {
            "type": "string",
            "example": "Bug Screenshot"
          }
        },
        {
          "label": "MIME Type",
          "value": "mimetype",
          "schema": {
            "type": "string",
            "example": "image/png"
          }
        },
        {
          "label": "File Type",
          "value": "filetype",
          "schema": {
            "type": "string",
            "example": "png"
          }
        },
        {
          "label": "Pretty Type",
          "value": "pretty_type",
          "schema": {
            "type": "string",
            "example": "PNG"
          }
        },
        {
          "label": "User",
          "value": "user",
          "schema": {
            "type": "string",
            "example": "U0ABC12345"
          }
        },
        {
          "label": "User Team",
          "value": "user_team",
          "schema": {
            "type": "string",
            "example": "T0ABC12345"
          }
        },
        {
          "label": "Editable",
          "value": "editable",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Size",
          "value": "size",
          "schema": {
            "type": "number",
            "example": 256000
          }
        },
        {
          "label": "Mode",
          "value": "mode",
          "schema": {
            "type": "string",
            "example": "hosted"
          }
        },
        {
          "label": "Is External",
          "value": "is_external",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "External Type",
          "value": "external_type",
          "schema": {
            "type": "string",
            "example": ""
          }
        },
        {
          "label": "Is Public",
          "value": "is_public",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Public URL Shared",
          "value": "public_url_shared",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Display As Bot",
          "value": "display_as_bot",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Username",
          "value": "username",
          "schema": {
            "type": "string",
            "example": ""
          }
        },
        {
          "label": "URL Private",
          "value": "url_private",
          "schema": {
            "type": "string",
            "example": "https://files.slack.com/files-pri/T0ABC-F07GHI11223/screenshot.png"
          }
        },
        {
          "label": "URL Private Download",
          "value": "url_private_download",
          "schema": {
            "type": "string",
            "example": "https://files.slack.com/files-pri/T0ABC-F07GHI11223/download/screenshot.png"
          }
        },
        {
          "label": "Media Display Type",
          "value": "media_display_type",
          "schema": {
            "type": "string",
            "example": "unknown"
          }
        },
        {
          "label": "Permalink",
          "value": "permalink",
          "schema": {
            "type": "string",
            "example": "https://myworkspace.slack.com/files/U0ABC/F07GHI11223/screenshot.png"
          }
        },
        {
          "label": "Permalink Public",
          "value": "permalink_public",
          "schema": {
            "type": "string",
            "example": "https://slack-files.com/T0ABC-F07GHI11223-a1b2c3d4e5"
          }
        },
        {
          "label": "Comments Count",
          "value": "comments_count",
          "schema": {
            "type": "number",
            "example": 0
          }
        },
        {
          "label": "Is Starred",
          "value": "is_starred",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Shares",
          "value": "shares",
          "schema": {
            "type": "object",
            "example": {
              "private": {
                "D0ABC12345": [
                  {
                    "ts": "1737024600.111333",
                    "share_user_id": "U0ABC12345",
                    "reply_count": 0
                  }
                ]
              }
            }
          }
        },
        {
          "label": "Channels",
          "value": "channels",
          "schema": {
            "type": "array",
            "example": []
          }
        },
        {
          "label": "Groups",
          "value": "groups",
          "schema": {
            "type": "array",
            "example": []
          }
        },
        {
          "label": "IMS",
          "value": "ims",
          "schema": {
            "type": "array",
            "example": [
              "D0ABC12345"
            ]
          }
        },
        {
          "label": "Has More Shares",
          "value": "has_more_shares",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Has Rich Preview",
          "value": "has_rich_preview",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "File Access",
          "value": "file_access",
          "schema": {
            "type": "string",
            "example": "visible"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
