3 Replies Latest reply on Jul 13, 2013 11:23 AM by Kutir Mobility

    Filetransfer seems not working and is it the good solution

      Hi there,

       

      My first question

      I followed step by step a ruby example for downloading files finding here http://docs.rhomobile.com/rhoelements/FileTransfer

       

      So I made a called Rhomodel FileTransfer.

      In the file_transfer_controller.rb, i added  this :

      require 'autocomplete/FileTransfer'

      ...

      And in the class, i added this :

       

        def downloadFile

            FileTransfer.transferEvent=url_for(:action => :transferEventListener)

            FileTransfer.source="url('http://www.sompi.fr/images/sompi/actu_vinisudw.jpg')"

            v_destination = File.join(Rho::RhoApplication::get_base_app_path(), '/public/images/actu_vinisudw.jpg')

            FileTransfer.destination="url('fil://"+v_destination+"')"

            FileTransfer.transfer

        end

       

      In my app/index.erb i added this :

      <script type="text/javascript">

      function tranferLocal() {

         alert('go !');

          $.get('/app/FileTransfer/downloadFile', { });

          return false;

      }

      </script>

      ...

      <button onclick="tranferLocal();" >Transfer file locally</button>

       

      I don't receive my image. I have no error. I checked everything i can and i don't understand where's my mistake.

       

      My second question :

      I'm not sure is the good solution for making a app which :

      - download multiple binary files (pdf, jpg...) on device with some filesize > 4 M.

      - download script for populate database on device

       

      I saw Rhoconnect with sync and followed the tuto.

      What do you think ?

       

      Regards,