1

in my node application I want to use FormData to upload a remote image. To do this I'm trying the following

  const form = new FormData();
  ...
  const result = await fetch(image);
  form.append("file", result.body);
  ...

This is generating the following error:

TypeError: source.on is not a function

I'm wondering what I have to pass to form.append to make it work. I tried also using result.blob() without any luck. Any help appreciated.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.