Cordova FIle Transfer插件如何传递transloadit参数? [英] Cordova FIle Transfer plugin how to pass transloadit parameters?

查看:160
本文介绍了Cordova FIle Transfer插件如何传递transloadit参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新 尝试使用以下代码使用FileTransfer插件将文件发布到Transloadit

Update Trying to post the file to transloadit using the FileTransfer plugin using the following code

     var uri = encodeURI("https://api2-eu-west-1.transloadit.com/assemblies");
            var options = new FileUploadOptions();
            options.fileKey = "file";
            options.fileName = filepath.substr(filepath.lastIndexOf('/') + 1);

            var params = new Object();
            params.auth =new Object();
            params.auth.key ="***************" ;

            options.params = params; 
            var ft = new FileTransfer();
            ft.upload(filepath, uri, win, fail, options);

我收到错误"no_params_field",未提供参数字段" 我还尝试将参数作为选项传递

I get the error "no_params_field", "No Params Field Provided" I also tried passing params as options

    ft.upload(filepath, uri, win, fail, params);

可以帮您如何使用FileTransfer插件发送transloadit参数吗?

Can you please help how to send the transloadit params with the FileTransfer plugin?

谢谢

推荐答案

找到了它,它应该作为

    var params = {};
            params.params = new Object();
            params.params.auth = {key: "***"};

然后

    ft.upload(filepath, uri, win, fail, {params: params});

谢谢

这篇关于Cordova FIle Transfer插件如何传递transloadit参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆