Yes, you can, but you need to put the file on a location that's available for the HTML. Either on the same server where your HTML code lives or another server that's accessible from your HTML file, such as public web sites (e.g.
https://imgur.com/ or any other site that allows you to upload images).