Do you need an image uploader that can generate an image URL that isn't extremely long, without reloading the page? Luckily, I've got you covered. I created my own image uploader, and you can use it too. Here's how to use it.
How to use Image Uploader
First, we create the HTML input:
Next is the
uploadFile function, where we will use the
fetch method to generate a URL for the file:
If you upload a file that isn't an image, it will give you an error that says
TypeError: Failed to fetch.
I hope this was helpful!