Slack - how to post a link to network folder?

Alex E picture Alex E · Mar 21, 2016 · Viewed 11.4k times · Source

I'm using a webhook to post messages to Slack via PowerShell script and I'd like to include a link to a network folder. I was able to do it with

    <file://server/folder|files>

however when the generated 'files' link is clicked nothing happens. Is there a way to specify target so that a clicked link opens in a new window? If I copy the generated link and paste it into the browser, the index is rendered just fine and that would be sufficient for my purposes. Are there any alternative solutions?

Answer

Adil B picture Adil B · Dec 20, 2017

You may have some success with Slack's Link Buttons, which specifically open links in new browser tabs when clicked.

{
    "text": "Test Link Buttons",
    "channel": "C061EG9SL",
    "attachments": [
        {
            "fallback": "Test link button to file://server/folder",
            "actions": [
                {
                    "type": "button",
                    "name": "file_request_123456",
                    "text": "Test",
                    "url": "file://server/folder",
                    "style": "primary",
                    "confirm": "Really?"
                }
            ]
        }
    ]
}

Slack Message Builder example