简体   繁体   中英

Create progress bar for ArrowDB pre-built Files API

I created an upload functionality in my app based on the pre-built API of ArrowDB to upload "Files". That works very well so far and reduces the issues on developer-side (great work, Appcelerator! :D) - I want to build now a progress bar, where the user is able to see how far the upload currently is, because in the today's world an iPhone image can easily be a couple of mega bytes and the internet connections depends...

The example code of the documentation looks as follows:

  Cloud.Files.create({
        name: 'test.dat',
        file: Titanium.Filesystem.getFile('test.dat')
        }, function (e) {
        if (e.success) {
            var file = e.files[0];
            alert('Success:\n' +
                'id: ' + file.id + '\n' +
                'name: ' + file.name + '\n' +
                'updated_at: ' + file.updated_at);
        } else {
                alert('Error:\n' +
                    ((e.error && e.message) || JSON.stringify(e)));
            }
  });

Source: http://docs.appcelerator.com/arrowdb/latest/#!/api/Files-method-create

The problem: It seems only to return one status at the end, it can be "e.success" - or everything else - handled as an arrow...

Thanks for any help!

目前,无法获取有关上传状态的更新。

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