Possible to send a file to discord through the webhook?

I only found this guide but still not sure on how to go about sending a txt file specifically.

From the site

Sending files using webhooks is only possible using Content-Type: multipart/form-data header. Using this method also means you have to set json body as value of payload_json parameter.

Parameter names should have unique names otherwise they will collide and only first file from ones with identical names will be shown.

Where do I get the boundary data from?

Just upload it to a host with documentation and include the DL in the webhook message

As far as I know, it is not possible to send files via webhook.

Try sending it as a content, you can use up to 2000 characters.

Very simple.

BLOCK:HttpRequest
  url = "Discord Webhook URL"
  method = POST
  TYPE:MULTIPART
  ""
  CONTENT:FILE "Textfile" "PATH TO TXT FILE" "application/octet-stream"
ENDBLOCK

and result

image

4 Likes

Nice, do you know if this was added recently?

no, multiparts been a thing since release and it was in ob1 as well

1 Like

Brilliant! I can confirm it’s working.