How can I post an image from local directory to the Strapi Media Library?

Is poster.jpg in the same directory as the file that contains the sample code?

Explaining what you’re trying to achieve will help curate an answer - for example, is this running in a browser and you’re using a file input field, or is this running on another Node.js server and the poster.jpg image is on that server?