Read the documentation:
Every command usable from the cli is also available through the HTTP API. For example:
ipfs swarm peers
So for the command:
USAGE ipfs add ... - Add a file to ipfs.
ARGUMENTS
< path >... - The path to a file to be added to IPFS.
https://ipfs.io/docs/commands/#ipfs-add
the equivalent API call would be:
curl -F "image=@/home/bar.jpg" 127.0.0.1:5001/api/v0/add
If you want to use a webpage to upload a document into ipfs it should be something like
<form action="http://127.0.0.1:5001/api/v0/add">
<input type="file" name="image" accept="image/*">
<input type="submit">
</form>