Friday, 4 September 2020

How can I upload an image buffer directly to a website with puppeteer?

What I’ve figured out how to do so far is this:Download image from somewhere like imgur, capture as buffer, write to diskUse elementHandle.uploadFile(path) to upload this disk image to any pageHowever, i’m looking to remove the disk middleman. In other words, upload that buffer directly to the page, without saving to disk. How could I accomplish this?

Submitted September 04, 2020 at 05:15PM by allsavage

No comments:

Post a Comment