People like to see that they picked the right picture before they press Send. You can show it instantly, and nothing has to leave their device for that.
<input type="file" id="pick" accept="image/*">
<img id="preview" alt="Preview of your photo" width="300">
<script>
let url;
pick.addEventListener('change', () => {
if (url) URL.revokeObjectURL(url);
const file = pick.files[0];
if (!file) return;
url = URL.createObjectURL(file);
preview.src = url;
});
</script>
The function returns a short blob: address that points at the file in memory. It is immediate, even for a big photo, because nothing is converted into a long text string.
The revokeObjectURL line frees the previous one. Without it every new choice keeps another copy around until the page closes.
I would not trust the preview as validation. accept is a hint to the file picker, and a user can still choose something else, so your server has to check the upload itself. Some image formats that a phone produces may also fail to display in some browsers even though the upload would work.
Further reading: MDN: URL.createObjectURL()