I just added multipe steps into my template, now the onResult is not returning ever...

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

I am trying to get my the onResult to return anything for this template: REDACTED

it was working just fine when i only had one thing in my step. But now i have 4 things.

`function showData(step, response){

console.log(response);

} $(document).ready(function() { // Handler for .ready() called.

var data = {wait:true, autoSubmit:false,onResult:showData};
$('#MyForm').transloadit(data);

}); `

I think the callback you are looking for is the onSuccess one. Can you give that a shot and see if it works?

It looks like i could potentially use this, but my problem still exists.

The moment i have multiple steps. It seems like onSuccess is not being called.

I am using: template: REDACTED

and here is the code:
`

            function showData(assembly){
                console.log(assembly);
            }
            $(document).ready(function() {
              // Handler for .ready() called.
                var data = {wait:true, autoSubmit:false,onSuccess:showData};
                $('#MyForm').transloadit(data);

            });
        </script>

`

If i just have store call it seems to work fine. But not if there is more than one store call.

Hey,

I can’t actually look into your template easily (for privacy reasons). I could work around that if you give me permission. Anyway, I noticed that your last 3 assemblies were actually failing, which would explain the onSuccess / onResult callbacks not being called. I think you are doing something that causes our cropping code to fail, is that possible?

Anyway, try adding an onError callback an see what you get.

Your right. I am getting an error: See attached photo.

Below is the code in my template:(i removed my secret… ). Do you see anything wrong?

{
"steps": {
"thumbnail": {
"robot": "/image/resize" ,
"width": "122" ,
"height": "122" ,
"resize_strategy": "crop"
},
"view": {
"robot": "/image/resize" ,
"width": "296",
"resize_strategy": "crop"
},
"store_original": {
"use":":original",
"robot": "/s3/store" ,
"bucket": "media.frissc" ,
"key": "REDACTED" ,
 },
"store_thumbnail":
{
"use": ["thumbnail"],
"path":"${unique_prefix}/${file.meta.width}/t/${file.urlName}",
"robot": "/s3/store" ,
"bucket": "media.frissc" ,
"key": "REDACTED" ,
 },
"store_view":{
"use": ["thumbnail"],
"path":"${unique_prefix}/${file.meta.width}/v/${file.urlName}",
"robot": "/s3/store" ,
"bucket": "media.frissc" ,
"key": "REDACTED" ,

}
}
}

Yeah, your view step is lacking a height parameter. The crop resize method always needs width and height, but I think this isn’t documented right now (nor is our error message very good). Can you try adding a height and see if this fixes your problem? Then I can update the docs and error message.

that seems to have worked nicely. Thanks Felix.

As a feature add.

It would be nice to be able to use the “step” as a path variable.
$(step)/myfile.jpg.

Thanks again! So far so good.

-Mark

2010/10/4 Felix Geisendörfer <
***@tenderapp.com<tender%***@tenderapp.com>
>

You want to use the current step, or that of the previous robot (that led to the /s3/store step) as a variable?

Closing this since the thread is inactive. Please feel free to re-open if there are still remaining problems!