📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

@e-is/cordova-plugin-downloader

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e-is/cordova-plugin-downloader

Downloader

1.2.0
latest
Source
npm
Version published
Maintainers
0
Created
Source

Android Downloader Cordova plugin

Forked from integrator-cordova-plugin-downloader

This plugin is designed to support downloading files using Android DownloadManager.

Supported platforms

  • Web
  • Android
  • iOS

Installation

cordova plugin add @e-is/cordova-plugin-downloader

Usage

Create download request. For more info on parameter use refer to DownloadRequest.


var request = {
	//Location of the resource to download
	uri: '',
	//Title of this download, to be displayed in notifications
	title: '',
	//Description of this download, to be displayed in notifications
	description: '',
	//This will override the content type declared in the server's response.
	mimeType: '',
	//Set whether this download should be displayed in the system's Downloads UI. True by default
	visibleInDownloadsUi: true,
	//Control when a system notification is posted by the download manager.
	notificationVisibility: 0,
	// Set the local destination to a path within the application's external files directory
	destinationInExternalFilesDir: {
		dirType: '',
		subPath: '' //Path within the external directory, including the destination filename
	},
	//Set the local destination to a path within the application's public external storage directory
	destinationInExternalPublicDir: {
		dirType: '',
		subPath: '' //Path within the external directory, including the destination filename
	},
	//Set the local destination for the downloaded file.
	destinationUri: '',
	//Additional HTTP headers to be included with the download request.
	headers: [{header: 'Authorization', value: 'Bearer iaksjfd89aklfdlkasdjf'}]
};

Starts download and returns location uri on completion


cordova.plugins.Downloader.download(request,
		(location) => { alert('File is downloaded at ' + location) },
		(err) => { alert(err)})

Credits and License

Based on Luka313's integrator-cordova-plugin-downloader Based on Emil Bay's cordova-plugin-android-downloadmanager

Keywords

ecosystem:cordova

FAQs

Package last updated on 30 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts