angularQFileUpload AngularJS 大文件上传

程序名称:angularQFileUpload

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

angularQFileUpload 介绍

angularQFileUpload 是一个 AngularJS 扩展,实现了通过七牛云储存上传大文件的服务,支持恢复、进度等功能。

示例代码:

$scope.selectFiles = [];

var start = function (index) {
    $scope.selectFiles[index].progress = {
        p: 0
    };
    $scope.selectFiles[index].upload = $qupload.upload({
        key: '<your qiniu file key>',
        file: $scope.selectFiles[index].file,
        token: '<your qiniu UpToken>'
    });
    $scope.selectFiles[index].upload.then(function (response) {
        // upload success
        $log.info(response);
    }, function (response) {
        // upload failure
        $log.info(response);
    }, function (evt) {
        // progress
        $scope.selectFiles[index].progress.p = Math.floor(100 * evt.loaded / evt.totalSize);
    });
};

$scope.abort = function (index) {
    $scope.selectFiles[index].upload.abort();
    $scope.selectFiles.splice(index, 1);
};

$scope.onFileSelect = function ($files) {
    var offsetx = $scope.selectFiles.length;
    for (var i = 0; i < $files.length; i++) {
        $scope.selectFiles[i + offsetx] = {
            file: $files[i]
        };
        start(i + offsetx);
    }
};

angularQFileUpload 官网

https://github.com/icattlecoder/angularQFileUpload

相关编程语言

MuPlayer 是一款跨平台、轻量级的音频播放解决方案,...
OS FLV 是一个 开源和可嵌入网页的flv播放器。 这个...
DewPlayer音乐播放器,样式很简单,而且很实用.播放器...
JW FLV MEDIA PLAYER是一个开源的在网页上使用的Fla...
Speakker 是一个基于 Web 浏览器的音乐播放器,只提...
Player Framework 是一个开源的支持 HTML5 的视频播...