I'm using nodejs to push up an image to a repo from the src endpoint using multipart/form post and no matter how I send it, binary, text, raw it's always unusable after upload. What is the proper way to upload an image from node? I have successfully pushed plain text files but not images/binary data. I am using the npm FileReader package to read the file contents and I've tried
readAsArrayBuffer
readAsBinaryString
readAsText
but nothing seems to work. I'm using the npm package "form-data" to do the form post which works fine for regular text files.
Also is base64 encoding supported? It doesn't appear to be supported because the api doesn't decode the file after upload and I can't send the "Content-Transfer-Encoding": "base64" header because it's not allowed from the CORS pre-flight request. Seems like base64 encoding is important for multipart form posts of binary data.
Any help appreciated!