Fetches a file from the given URL and returns it as a File object.
Automatically infers the file type.
Assumes the last part of the URL is the filename.
Parameters
url: undefined|string
The URL to fetch the file from.
Returns undefined|File
The fetched file as a File object or undefined if the file could not be fetched.
Example
// File is `undefined` until the file is fetched or if the request fails constfile = useRemoteFile("https://example.com/image.png");
Fetches a file from the given URL and returns it as a File object. Automatically infers the file type. Assumes the last part of the URL is the filename.