Skip to content

Instantly share code, notes, and snippets.

@litzinger
Created July 10, 2012 20:29
Show Gist options
  • Save litzinger/3086050 to your computer and use it in GitHub Desktop.
Save litzinger/3086050 to your computer and use it in GitHub Desktop.
ProForm file download
<?php
// Call this in the sessions_end() hook in ext.ariba.php
private function _check_for_file_download()
{
$file = $this->EE->input->get('file_download');
$this->EE->config->_global_vars['global:download_file_url'] = FALSE;
if ($file AND $this->EE->input->get('file_step') == '1' /* Key to preventing redirect loop */)
{
$this->EE->config->_global_vars['global:download_file_url'] = $file;
}
}
/*
in proform submit end set the redirect to wherever proform wants to redirect to + ?file_step=1&file_download=http://path/to/file
it will do a redirect, this calling sessions_end() on the next page load. The above func will see that a file is requested and set the global var, which can be added to the header...
{if global:download_file_url}
<meta http-equiv="refresh" content="0;{global:download_file_url}" />
{/if}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment