See: files.upload retires in March 2025, replaced by sequenced Web API methods
files.upload API was replaced to files.getUploadURLExternal and files.completeUploadExternal.
However, those new APIs are complex and not easy to use with curl. So, I made this small CLI tool to upload files to Slack.
$ curl -sL -o suc https://github.com/pyar6329/slack-upload-cli/releases/download/1.0.1/suc-$(uname -s)-$(uname -m)
$ chmod +x suc
$ ./suc --helpPlease move suc command to PATH directory.
Usage: suc [OPTIONS]
Options:
-u, --upload <FILE_PATH> upload file to slack. Please set path of a file.
-s, --send <SEND_MESSAGE> send a message to slack. Please set message text.
-h, --help Print help
-V, --version Print versionplease set below environment variables
export SLACK_API_TOKEN="xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-"
export SLACK_CHANNEL_ID="C12345678"run the command
$ suc -u /path/to/filerun the command
$ suc -s "Hello, World!"