SourceForge has been redesigned. Learn more.
Close

Trigger file download on render finish

Anonymous
2011-03-10
2012-11-26
  • Anonymous

    Anonymous - 2011-03-10

    I'd like to trigger a file download once the render script has finished.

    I've been looking through the encoding.php and see where the progress/status is output - but I'm just not seeing where it terminates.

    I'd like to add a PHP function that downloads the file once the process is complete, but I've had absolutely no luck.

    Just wondering if anyone has done this or if you could point me in the right direction, because right now, I'm at a loss.

    Thanks!

     
  • doug

    doug - 2011-03-10

    Hi Jeremy,

    This particular functionality has been unavailable since Adobe introduced the security restriction that requires file downloads to be initiated by a MouseEvent. Since then I've thought of a way to perhaps work around this restriction but haven't had a chance to test or rewrite the CGI class to accommodate a different flow. There's currently no way to do it through configuration changes.

    Sorry,
    doug

     
  • Anonymous

    Anonymous - 2011-03-10

    So, there isn't a way I could fire a PHP function once the encoding.php loop is complete?

    I see that the encoding.php fires a function to refresh the mash browser, I was thinking that I could include a request to go grab the completed file like this:

    header('Content-type: video/x-msvideo');
    header('Content-Disposition: attachment; filename="media.avi"');
    readfile('[b][path to file][/b]/media.avi');
    

    At what point in the encoding.php file does it stop the render and tell the app that it's finished encoding?

     
  • PJPS

    PJPS - 2012-02-07

    I too would like to know the best way to trigger a php function at the end of rendering.  Not to trigger a download, but to trigger anything :).  The best "hook" to use I suppose is what I'm asking.

     
  • doug

    doug - 2012-02-07

    In the current version the CoderDoneURL job option can be specified, which will be requested when the job has completed and been transferred. In the next version you can set up a Text Output having a Trigger of 'done' (without error) or 'complete' (regardless of errors).

     
  • PJPS

    PJPS - 2012-02-07

    Perfect!  Thanks again for the quick response.

    Cheers,
    PJ

     
  • PJPS

    PJPS - 2012-02-07

    I see CoderDoneURL is set and used in various files (encode,decode,done,etc).  How can I differentiate between users added media, lets say, and the output of the "render" button being pressed?

     
  • doug

    doug - 2012-02-07

    Well, in the current example every decode (render) job is followed immediately by an 'encode' (preprocess) job. In the first job, the CoderDoneURL is pointing to decoded.php, which creates the second. That would be a good place to introduce new logic.

     

Log in to post a comment.