Closed JasonKoopmans closed 1 year ago
Hey @JasonKoopmans,
That sounds interesting. Especially how that relates to the lifetime of the reference to it. It is the plan to implement the entire File API in which these methods are defined. I will ensure that I update you when that is accomplished. 🙂
An update on this is that I have started the development of the FileAPI wrapper as its own project. Once that is more featureful and published to Nuget this package will be updated to use it. https://github.com/KristofferStrube/Blazor.FileAPI
This was implemented as a part of #28 and has been published in version 2.0.0 to NuGet.
From the Blazor.FileAPI package you can use the URLSerivce to call CreateObjectURLAsync
with some Blob
.
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
Implementing this API permits the creation of browser addressable urls for
File
andBlob
.These examples provide some tangible use cases.
https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications#example_using_object_urls_to_display_pdf
A drag is the need to also implement
URL.revokeObjectURL
which deallocates a url resource to refer to the object.https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL