Webhook support for base64 encoded images #6194
-
I have been testing a few things with discord webhooks. Would it be possible to support base64 encoded images in multipart/form-data? This would really help speed up some of the development goals I have. Thanks for considering. --boundary [base64 string] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
FormData is a web standard, and doesn’t (exactly) relate to the Discord API. Every website/server you send FormData to expects you to send the raw bytes of your file, that’s just how FormData works. |
Beta Was this translation helpful? Give feedback.
-
You can omit the base64 encoding step (or if the data is already coming in as base64, you can decode it). |
Beta Was this translation helpful? Give feedback.
I got it working. reading rfc 2046
--boundary
Content-Disposition: form-data; name="files[0]"; filename="myfilename.png"
Content-Type: image/png
Content-transfer-encoding: base64
[base64 string]