useObjectURL
React Hook that receives an instance of File
, Blob
or MediaSource
and creates an URL representing it. It releases URL when component unmount or parameter changes.
; const DownloadFileLink = { const fileURL = ; return <a href=fileURL target="_blank" download=filename> Download </a> ;};
Installation
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install use-object-url --save # For Yarn, use the command below. yarn add use-object-url
Installation from CDN
This module has an UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. --> <!-- For JSDelivr use the code below. -->
Documentation
Documentation generated from source files by Typedoc.
License
Released under MIT License.