slackapi / slackapi/python-slack-sdk

Uploaded files are not appearing in channel and do not contain mimetype

Open
#1,575 39 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triage-skip question server-side-issue Version: 3x web-client
Dominant language
Python
Stars
4k
Forks
857
Avg merge
22h 21m
Merged PRs (30d)
16

Description

I am trying to upload a file to a private Slack channel using the Slack API via the following Python script.
However, once uploaded, the file cannot be downloaded by users in the channel. I am looking for help to understand why this is happening and how to resolve it.

Python runtime version

3.12.1

I used these step:
  1. https://slack.com/api/files.getUploadURLExternal
  2. https://slack.com/api/files.completeUploadExternal
  3. https://slack.com/api/files.sharedPublicURL
Actual result:
{
  "ok": true,
  "file": {
    "id": "XXXXXXXXXX",
    "created": 1729848820,
    "timestamp": 1729848820,
    "name": "xxxxxxxxxxxxxxxxxx.xxx",
    "title": "xxxxxxxxxxxxxxxxxxxx.xxx",
    "mimetype": "",
    "filetype": "",
    "pretty_type": "",
    "user": "XXXXXXXXX",
    "user_team": "XXXXXXXX",
    "editable": false,
    "size": 61652577,
    "mode": "hosted",
    "is_external": false,
    "external_type": "",
    "is_public": false,
    "public_url_shared": true,
    "display_as_bot": false,
    "username": "",
    "url_private": "https://files.slack.com/files-pri/xxxxxxxxx-xxxxxxxxxx/xxxxxxxxxxxxxxxxxx.xxx",
    "url_private_download": "https://files.slack.com/files-pri/xxxxxxxxxxxxx-xxxxxxx/download/xxxxxxxxxxxxxxxxxx.xxx",
    "media_display_type": "unknown",
    "permalink": "https://xxxxxxxxx.slack.com/files/xxxxxxxxxx/xxxxxxxxxxxxxxx/xxxxxxxxxxxxx.xxx",
    "permalink_public": "https://slack-files.com/xxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxx",
    "comments_count": 0,
    "is_starred": false,
    "shares": {},
    "channels": [],
    "groups": [],
    "ims": [],
    "has_more_shares": false,
    "has_rich_preview": false,
    "file_access": "visible"
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three Slack API calls shown in the issue: files.getUploadURLExternal, files.completeUploadExternal, and files.sharedPublicURL, using the provided Python runtime details. Compare the resulting file visibility, channel association, and mimetype fields with the Slack API documentation. Done means the cause is documented or a concrete SDK change is identified, with a reproducible test case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.