Skip to content

Set a default filename so that Slack displays the file preview correctly - #599

Open
dblock wants to merge 1 commit into
slack-ruby:masterfrom
dblock:fix-files-upload-filename-preview
Open

Set a default filename so that Slack displays the file preview correctly#599
dblock wants to merge 1 commit into
slack-ruby:masterfrom
dblock:fix-files-upload-filename-preview

Conversation

@dblock

@dblock dblock commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Finishes #375 as a patch.

Since 2021/05/05, Slack no longer correctly displays image previews for files uploaded via files_upload when no filename is specified. Faraday::UploadIO/multipart-post falls back to the local IO path as the filename in that case, and Slack treats the file as binary if the filename looks like a path.

This sets a default filename of 'file' when :file is present but :filename is not, matching the fix originally proposed in #375 by @ts-3156.

Closes #375.

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock force-pushed the fix-files-upload-filename-preview branch from 1812651 to f4e5f47 Compare August 29, 2026 22:45
Fixes files_upload not showing image previews when filename is not
specified, since multipart-post falls back to the local IO path as
the filename, which Slack treats as a binary file.

Co-authored-by: ts-3156 <ts_3156@yahoo.co.jp>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the fix-files-upload-filename-preview branch from f4e5f47 to db550e0 Compare August 29, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant