slack-ruby/slack-ruby-client

Unable to upload xlsx file

NBuhinicek opened this issue · 4 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.

Maybe something slack-side?

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

duffn commented

It doesn't appear to be possible to generate a preview when uploading via the API per slackapi/python-slack-sdk#991 (comment)

duffn commented

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 file=@test.xlsx -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