I have a javascript file object like so:
and I would like to turn it into a url so that the file can be accessed through the url. How would I go about generating a url for this file through javascript?
The javascript for the file object is something like this:
const file = new File(["blob data"], "foo.txt", {
type: "image/png",
});
I would like to pass this file variable somewhere and have a url generated for it. Is that possible?
This one was really one google search away my friend, unless I misunderstood your needs?
objectURL = URL.createObjectURL(object);