<?php
/** Loads the WordPress Environment and Template */
require('../../../wp-blog-header.php');
session_start();
zing_tickets_login();
$http=zing_tickets_http("osticket",'scp/wp_attachment.php');
$news = new zHttpRequest($http,'zingiri-tickets');
if ($news->live()) {
$output=$news->DownloadToString();
list($ctype,$filename,$file)=explode(',',$output);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Type: $ctype");
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
if ((is_integer(strpos($user_agent,"msie"))) && (is_integer(strpos($user_agent,"win"))))
{
header( "Content-Disposition: filename=".basename($filename).";" );
} else {
header( "Content-Disposition: attachment; filename=".basename($filename).";" );
}
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
readfile($file);
die();
}
?>