How to upload from BUFFER?

@ab4583325 Nice work, so far. A couple of questions to better give you guidance.

Is the user selecting the image within the HTML Component? If not, having them select the image that would be the best place, so that you will not have to pass the data between your Wix page and the HTML Component via .postMessage(). That’s important because Post Message also has a limit on the size of the string you can pass.

If you’re already doing that, you can try the following.

1. Create An Upload Form in the HTML and Send Upload URL to HTML Component

You can send the generated Upload URL over to the HTML Component using https://www.wix.com/velo/reference/$w/htmlcomponent/postmessage

Once you’ve sent it, you can then take the URL inside the component and set it to the action of the form.

I’ve written some code for the HTML Component to guide you. You’ll have to set the uploadURL to your own in the component. You’ll need to https://stackblitz.com/edit/web-platform-tmegez?file=index.html

Why a form Chris?
What about the Data URL?

The API is looking out for a FormData formatted body in the post data, which you can do easily by using an HTML Form. If you definitely don’t want to create a form just to upload, you can also create formData using Javascript, within the HTML Component Using FormData Objects - Web APIs | MDN