简体   繁体   English

为ArrowDB预制文件API创建进度栏

[英]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". 我基于ArrowDB的预构建API在我的应用程序中创建了上传功能,以上传“文件”。 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... 到目前为止,效果很好,并减少了开发人员方面的问题(出色的工作,Appcelerator!:D)-我现在想构建一个进度条,用户可以在其中查看当前上传的距离,因为在当今世界,iPhone图像很容易达到几兆字节,并且互联网连接取决于...

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 来源: 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... 问题:似乎只能在末尾返回一个状态,它可以是“ e.success”(成功)或其他所有内容,如箭头所示...

Thanks for any help! 谢谢你的帮助!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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