Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a Slack app also have a preview for uploaded file using files_upload? #991

Harshg999 opened this issue Apr 6, 2021 · 2 comments
question M-T: User needs support to use the project


Copy link

Hi Everyone,

Using files_upload from the SDK Web Client,

Is there a way for Slack App to also have a preview for the file uploaded just like a normal user gets when uploading it ??

Screenshot 2021-04-06 at 7 13 08 PM

Thanks in advance!

@misscoded misscoded added question M-T: User needs support to use the project and removed untriaged labels Apr 6, 2021
Copy link

Hi @Harshg999! Great question. 🙂

So, as far as bot file uploads go, with the files_upload method it's not possible to add a custom preview to the file (in this case, to mimic the preview seen when an end user does an upload "by hand" in the client).

If you still wanted to add a custom preview, you could use the files_remote_add method instead (example, docs). The value for preview_image is what is shown when your file is shared (these added files must be explicitly shared using the files_remote_share method (docs)).

As their name implies, files_remote_add and files_remote_share require that you to host the files remotely, so you'll have to decide if that's a tradeoff you're comfortable with making to get a custom preview.

Hope this helps. Let me know if you have any further questions!

Copy link

Thank you for the answer @misscoded!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
question M-T: User needs support to use the project
None yet

No branches or pull requests

2 participants