I am curious to know how image is uploaded in an HTML form. I have seen at lots of places, that an image is being attached(like Gmail) or lots of other places where we select an image from disk to be processed on server.
So when exactly is the image is uploaded?
- Just with the moment I choose an image.
- It is encoded base64 and then sent with the form data.
Which one of these is true? And which should be used when?