0

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);

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);

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

Thanks

Mosta
  • 868
  • 10
  • 23
  • You can't get the path fron an input file, but XHR should work. Share your code. If you want a path you can use a file picker plugin or camera plugin – jcesarmobile Mar 15 '16 at 14:01
  • Thanks I will send you more details, I started to take the FIleTransfer approach using the FilePicker plugin, the purpose is to send the correct params to transloadit , but I did not get it working yet , it gets a message from tranloadit that the params are not supplied, I will give it another try today and tomorrow, if it didnt work I will send you the code, may be you advice how to send the params correctly through FileTransfer plugin, thanks – Mosta Mar 16 '16 at 12:58
  • Hi @jcesarmobile , I posted the code can you please help? – Mosta Mar 18 '16 at 14:30
  • It's asking for a "params" field on the params object. – jcesarmobile Mar 18 '16 at 15:41

1 Answers1

2

Found it , It should be passed as

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

Then

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

Thanks

Mosta
  • 868
  • 10
  • 23