简体   繁体   中英

Ng-file-upload show upload indicator

我正在使用ng-file-upload,并希望在上传过程中显示上传指示符,但我在文档中没有找到执行此操作的方法,但是可能有办法吗?

Even I was looking for a directive and tried using this one but then I moved to a better one that worked for me and was easy to configur and use and documentation and demos are enough to get the things right

Look at this directive: https://github.com/nervgh/angular-file-upload

The third argument of the then method has the progress.

Upload.upload({
        url: 'upload/url',
    }).then(function (resp) {
        ....
    }, function (resp) {
        ....
    }, function (evt) {
        var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
        console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM