Redirect after the assembly is complete instead of after upload complete?

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

Hello,

I have an assembly that transcodes a video to several output formats and writes them to S3. I am submitting the video file with a plain form (no jQuery plugin), and have configured a redirect URL. I need for the assembly to be fully complete, with the data available on S3 at the time that my server processes the submission. Transloadit seems to be redirecting as soon as the upload is complete , so that the assembly is still executing at the time that my server receives the request. How can I tell Transloadit to hold the request until completion of the assembly before responding with the redirect?

Thanks,
Bryan

Hey Bryan,

is there any reason for you to not use the jQuery plugin? It can do that easily for you with the wait parameter.

Kind regards,
Tim

We actually do have support for this right now, by setting "blocking": true in the top level of your params JSON.

However, we have a connection idle timeout of 2 minutes, so this really isn’t usable for videos right now. Regardless, I’d love to hear more about why you can’t use the jQuery plugin as well, maybe it’s an edge case we need to start supporting.

I can’t use the jQuery plugin because I’m uploading from a client application, not a browser. I’m sure that’s not something that people will need to do often, but what would be the solution if I simply needed this to work from a web browser with javascript disabled?

I suppose if my file size limit is low enough, 2 minutes may be enough. I can also hold the request on my server while I poll for updates from Transloadit (or use notifications), but that complicates code.

I’m sure that’s not something that people will need to do often, but what would be the solution if I simply needed this to work from a web browser with javascript disabled?

You would use our notify_url to receive a notification when the assembly is done.

I suppose if my file size limit is low enough, 2 minutes may be enough. I can also hold the request on my server while I poll for updates from Transloadit (or use notifications), but that complicates code.

Yes, polling for updates on the assembly_url is another way to go if you don’t want to use notifications.

I could also try to raise our idle timeout in node.js, but I’m worried that other parts of our stack, or proxies in between you and us, may not deal with this properly.

--fg