AngularJS 大文件上传 angularQFileUpload
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/icattlecoder/angularQFileUpload
- 软件文档: https://github.com/icattlecoder/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);
}
};
REST in Practice
Jim Webber、Savas Parastatidis、Ian Robinson / O'Reilly Media / 2010-9-24 / USD 44.99
Why don't typical enterprise projects go as smoothly as projects you develop for the Web? Does the REST architectural style really present a viable alternative for building distributed systems and ent......一起来看看 《REST in Practice》 这本书的介绍吧!
