How to share a private file in slack with everyone in workspace but not public?

Viewed 30

After my app got installed, users can upload files in direct message with my bot. Now I want to send a message to everyone and include this uploaded file but since it was uploaded in a private chat with my bot, this file is private.

I don't want to make it public(internet) available(also user should have this extra workspace permission to make files publicly available), just want to share it with everyone in the workspace only. so app.client.files.sharedPublicURL is not an option.

Maybe download the file using url_private and upload it again to slack using files.upload? which seems crazy!

Or with some other method which lets me change shares part of file to "general" channel so everyone can see it, do we have such method?

 {
  files: [
    {
      id: '...',
    ...
      
      user: '....',
      editable: false,
      
      mode: 'hosted',
      is_external: false,
      external_type: '',
      is_public: false,
      public_url_shared: false,
      display_as_bot: false,
      username: '',
      url_private: 'https://files.slack.com/files-pri/.../file.png',
      url_private_download: 'https://files.slack.com/files-pri/..../download/file.png',
     ....
      permalink: 'https://myworkspace.slack.com/files/....png',
      permalink_public: 'https://slack-files.com/...',
      has_rich_preview: false,
      file_access: 'visible'
      "shares": {
              "public": {
                  "C0T8SE4AU": [ 
                      {
                        ...
                          "channel_name": "general",  //<<<<<<means everyone? is this possible?
                       ...
                    }
                ]
            }
        },
    }
    
  ]..
}
   
0 Answers
Related