How to convert local image into base64 encoding

You haven’t detailed what you’ve tried, or included details on what code you currently have.

You will not have access to the local file system within the pre-request script.

If the API requires an base64 encoded string, you will either need to decode this before hand using another tool, or you could potentially send a request to Postman Echo as form data including the file, and the response returned will include the base64 encoding which you can then parse and use in your subsequent request.

Have a look at the following post to see how to use Postman Echo to return the base64 encoded string for a file.