http/import doesn't automatically start

Archived from the Transloadit support forum. Originally posted on February 20, 2014; details may be outdated, see our docs for current behavior. Original thread

I’m trying to use the dropbox dropin together with transloadit,

For this to work, the http/import should start as soon as I execute the transloadit() function.

So I’ve made a jsfiddle with the example from the transloadit docs
Shouldn’t the import start as soon as the page loads?

Because i’m not going to select a second file using the to upload, I just want to import the file from a url.

The docs example: http://jsfiddle.net/ludohelder/n8x8D/

The way I use it in in combination with dropbox (I can’t use the dropbox api in jsfiddle):

Dropbox.choose({
success: function(files) { $(‘#dropbox-form’).transloadit({ wait: true, triggerUploadOnFileSelection: true,

    params: {
      auth: { key: "REDACTED" }, 
      steps: {
        import: {
          robot: "/http/import",
          url: files[0]
        },
        resize: {
          robot: "/image/resize",
          use: ["import"],
          width: 130,
          height: 130
        }
      }
    }
  });
},
linkType:'direct',
multiselect:true,
extensions:['image']

});

Hey Ludo,

the .transloadit() function just enables your form to use Transloadit, it does not trigger the Transloadit actions right away.

You can trigger it with this code (you need to change it slightly of course to use your form):

var $el = $('#upload-form');
$el.transloadit({
  wait: true
});
$el.transloadit('start');

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

When I do it like that, it generates the following error
"Uncaught TypeError: Cannot call method ‘each’ of null "

See the updated jsfiddle:
http://jsfiddle.net/ludohelder/n8x8D/3/

Sorry, it must be $el.submit().

I have updated the fiddle.