Hi
I am using node-red 2.0.5.
In a function node, I am trying to import FormData and File modules form GitHub - octet-stream/form-data: Spec-compliant FormData implementation for Node.js package.
i.e. i am trying to find equivalent of
import {FormData, File} from "formdata-node"
Here are things I tried :
- in function node's setup, i tried this and in code i tried to use formdatanode.FormData but it couldn't find this object.
- then I tried this This didn't work either.
So what is the the right way to import ?
Second question (which is my real goal). I have a buffer object which contains a screenshot from my camera. I am trying to post it to telegram using their sendphoto rest endpoint. That requires a multipart form upload. So I am trying to send the buffer (along with content-type) and two other string parameters (chatId and caption). I could use their sdk, but I don't want to import whole SDK for just this single multiform post.
Any help will be appreciated.