In the "Title" field, enter a title for your file. Include the file extension if applicable (eg. ".php" for PHP files).
Enter the file's plain-text content in the "Content" field.
Optionally, select a file type from the "File Type" dropdown. Various text file formats like Markdown, JSON, PHP, or "Slack post" are supported. The default file type is "Slack Post".
JSON file example:
Result JSON file:
Because Slack has its own markup language & rules, using Markdown can be confusing. See this site for more information about Markdown support in Slack.
Sending binary files
Use the block "Send Binary File" from the Slack connector.
The following steps explain how to send a binary file:
In the "Filename" field, enter a name for your file. Include the file extension (eg. ".png" for PNG files).
Enter the files base64 encoded content in the corresponding field. If no base64 encoded string of your file's content is available, try to use the formula "Base64 encode". Formulas in placeholders
Specify the file's content type in the "Contenttype" field. (eg. image/png or application/pdf). Available file types
Optionally, you can write a message to introduce your file. This message will be prepended
Example with a PNG file:
Result:
Advanced tip for binary files:
Instead of hard coding the file content, use a connector that has an endpoint that returns a base64 encoded string of a file. For example the "Get File Contents As Base64" from the Dropbox connector.