Skip to content

derhorst/nativescript-download-progress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nativescript-download-progress apple android

This fork provides the ability to set headers on android

Introduction

This plugin allows you to download large files and provides progress updates.

Nativescripts http.getFile method stores the data in memory which causes out of memory exceptions with large files.

Installation

tns plugin add nativescript-download-progress

Javascript Example

var DownloadProgress = require("nativescript-download-progress").DownloadProgress;

var download = new DownloadProgress();
download.addProgressCallback(function(progress) {
    console.log('Progress:', progress);
})
download.downloadFile("http://ipv4.download.thinkbroadband.com/20MB.zip").then(function(f){
    console.log("Success", f);
}).catch(function(e){
    console.log("Error", e);
})

Typescript Example

import { DownloadProgress } from "nativescript-download-progress"

var download = new DownloadProgress();
download.addProgressCallback((progress)=>{
    console.log('Progress:', progress);
})
download.downloadFile("http://ipv4.download.thinkbroadband.com/20MB.zip").then((f)=>{
    console.log("Success", f);
}).catch((e)=>{
    console.log("Error", e);
})

License

Apache License Version 2.0, January 2004

About

Download large files in Nativescript with progress events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.2%
  • JavaScript 19.1%
  • Shell 7.9%
  • CSS 3.5%
  • HTML 3.3%