Statistics: Posted by Cristián Lávaque — December 9th, 2011, 2:34 am
$file = $vars['file'];
$filename = basename($file);
$length = filesize($file);
header("USING_XSENDFILE: TRUE"); //for testing
header("X-Sendfile: $file");
header("Content-Length: $length");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\"");
Statistics: Posted by fx_keith — December 7th, 2011, 9:40 pm
Statistics: Posted by Raam Dev — December 7th, 2011, 9:31 pm
Statistics: Posted by fx_keith — December 7th, 2011, 3:33 am
<?php
add_action ("ws_plugin__s2member_during_file_download_access", "my_s2_file_server");
function my_s2_file_server ($vars = array ())
{
if ($vars["serving"])
{
// Send file headers, and exit script execution.
print_r($vars); // For debugging.
exit ();
}
}
?>
Statistics: Posted by Jason Caldwell — December 7th, 2011, 2:58 am
else /* Else, ``if ($serving)`` , use local storage option (default).*/
header("X-Sendfile: $file_path");
Statistics: Posted by fx_keith — December 5th, 2011, 3:19 pm