slack-ruby-client icon indicating copy to clipboard operation
slack-ruby-client copied to clipboard

Unable to upload xlsx file

Open NBuhinicek opened this issue 3 years ago • 3 comments

Been trying to upload a xlsx file but the end result in slack is not what I expected.

test xlsx

Here is my code, almost the same as the one in the README

file = Faraday::UploadIO.new(
  'test.xlsx', 
  'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)

client.files_upload(
  channels: '#general', 
  file: file, 
  filetype: 'xlsx',
  filename: 'test',
  title: 'Xlsx test', 
  initial_comment: 'Check xlsx upload'
)

Been using the same code for pdf and csv upload (while changing mime_type, filetype and the file) and it was working fine.

NBuhinicek avatar Feb 02 '22 10:02 NBuhinicek

Maybe something slack-side?

dblock avatar Feb 02 '22 19:02 dblock

Contacted them now, will write back to you when I have more information

NBuhinicek avatar Feb 03 '22 17:02 NBuhinicek

It doesn't appear to be possible to generate a preview when uploading via the API per https://github.com/slackapi/python-slack-sdk/issues/991#issuecomment-814481675

duffn avatar Jun 12 '22 13:06 duffn

I think this can be closed. This isn't the library but the API itself. It exhibits the same behavior using the API directly.

curl -F [email protected] -F "initial_comment=Test xlsx" -F channels=C0000000 -H "Authorization: Bearer $SLACK_API_TOKEN" https://slack.com/api/files.upload
Screen Shot 2023-03-15 at 10 38 19 AM

duffn avatar Mar 15 '23 16:03 duffn