Displaying files in slack app
Description
I wanted to inquire about whether there is an option of displaying files (external) to the user in the Home Tab or a modal. The use case is to show the user a remote document along with profile information on the home page/modal. I'm aware of files.remote.share which sends the file as a message. But is there a way to show the file directly in a modal/home tab or maybe have a button in the modal which downloads the remote file for the user?
What type of issue is this? (place an x in one of the [ ])
- [ ] bug
- [ ] enhancement (feature request)
- [x] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [ ] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Hi @mrafiqi21, thanks for asking the question!
In addition to the remote files in blocks, you can use an image block as long as the image data URL is publicly accessible. There is no other way that we can suggest at this moment.
I hope this helps!
Image blocks doesn't work with PDF files, right?
@mrafiqi21 Yes, as the block type name indicates only image data is supported. For PDF files, a remote file with its preview would be the only feature you can use as of today.
Got it. Can we have the viewing of the pdf functionality in the slack app itself just like files which are uploaded by the user itself? Currently, files.remote.share shares the document in the channel (with no preview), but clicking on it downloads the file locally instead of opening the file in slack.
@mrafiqi21 To optimize the behavior, you can pass preview_image parameter (binary data - the API document is not correct) when your app performs files.remote.add API method. The binary data must be an image data. We don't have sample code in Node.js right now but this Python test script may be helpful to learn what to give.
Please note that, unliked the files uploaded in Slack, Slack is unable to generate preview data for you because remote files do not exist in Slack. Thus, your remote file creation API call must provide image data to Slack.
Is everything clear now?
I am clear with the preview part, but I am referring to viewing the complete file in slack itself instead of the file getting downloaded when the user clicks on it. Is that possible?

It’s not possible, unfortunately.