dl-file-from-url
v1.0.0
Published
A simple package to download a file from a url, and optionally set the file's name. Has support for modern browsers and also legacy browsers >IE11.
Downloads
9
Maintainers
Readme
What is this?
A method used to download files from a given URL and save them with a given name onto your device. Works with all modern and legacy browsers.
Installation
Run npm i download-file-from-url
Usage
import downloadFileFromUrl from "download-file-from-url";
const fileUrl = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf";
const fileName = "My Book"
downloadFileFromUrl(fileUrl, fileName)
Parameters
There are two parameters that are accepted which are the filePath
and fileName
, which are empty by default.