Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/revolunet/cordova-download-plugin
Download and unzip with progress callbacks
https://github.com/revolunet/cordova-download-plugin
Last synced: about 2 months ago
JSON representation
Download and unzip with progress callbacks
- Host: GitHub
- URL: https://github.com/revolunet/cordova-download-plugin
- Owner: revolunet
- Created: 2012-05-25T19:34:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-04-22T15:11:26.000Z (over 8 years ago)
- Last Synced: 2024-10-04T16:58:53.360Z (2 months ago)
- Language: Objective-C
- Size: 36.1 KB
- Stars: 10
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cordova Download Plugin
====:warning: DEPRECATED, use https://github.com/apache/cordova-plugin-file-transfer instead
Simple plugin allows native downloads from javascript and get notified via a progress callback.
The plugin is known to work from cordova 1.7 to 2.0
- multiple concurrent downloads
- progress callbacks for downloads and unzip operations
- auto detect ZIP files, unzip then delete original zip
- files are extracted in the `NSDocumentDirectory`of the application but you can override
- iOS only at the moment
Proudly made by the [revolunet team][2]Example :
--window.plugins.Download.start(
// File to download
'https://github.com/revolunet/incubator-cordova-js/zipball/master',
// success callback
function() { $(#'progress').html("SUCCESS"); },
// failure callback
function() { $(#'progress').html("FAILURE"); },
// progress callback
function(infos) {
var statusText = window.plugins.Download.status[infos.status];
$(#'progress').html = statusText + ' ' + infos.progress;
}
// here you can specify an absolute output directory where to place the file
// eg: '/Documents/mydownloads'
);There is a full working example at `index.html`.
Installation :
--- meet dependencies
- add FileDownload and FileDownloadPlugin to your iOS project
- add a reference to the plugin in your `Cordova.plist`, as `name=FileDownloadPlugin, value=FileDownloadPlugin`Dependencies :
--- [ASI http request][0]
- [SSZipArchive][1]
- The HTML demo page use [Lea Verou Progress polyfill][3] because YES, <progress> is not yet implemented in SafariTodo :
--- ~~Use `content-type` HTTP header instead of extension to detect ZIPs~~
[0]: https://github.com/pokeb/asi-http-request/tree
[1]: https://github.com/samsoffes/ssziparchive
[2]: http://revolunet.com
[3]: http://lea.verou.me/polyfills/progress/