How can I upload an image without page refresh; just using input type="file"
to server. I'm using PHP to upload the file. I also need to insert markdown code with a URL to the image, like this: 
to end of a textarea
.
How can I do this? Maybe using JS?
Thanks in advance