AngularJS 大文件上传 angularQFileUpload

码农软件 · 软件分类 · AngularJS 扩展 · 2019-03-16 17:56:37

软件介绍

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);
    }
};

本文地址:https://www.codercto.com/soft/d/1491.html

淘宝技术这十年

淘宝技术这十年

子柳 / 电子工业出版社 / 2013-5 / 45.00元

《淘宝技术这十年》内容简介:任何网站的发展都不是一蹴而就的。它在发展过程中会遇到各种各样的问题和业务带来的压力。正是这些问题和压力推动着技术的进步和发展,而技术的发展反过来又会促进业务的更大提升。如今淘宝网的流量排名已是全球前15名、国内前3名,其系统服务器也从一台发展到万台以上。 《淘宝技术这十年》从工程师的角度讲述淘宝这个超大规模互联网系统的成长历程,及其所有主动和被动的技术变革的前因后......一起来看看 《淘宝技术这十年》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

MD5 加密
MD5 加密

MD5 加密工具