I have been working on an anonymizer type of app (basically so I could browse restricted sites from within a firewall and for fun).
The problem I am having is using cURL to perform posts. I can perform the post okay, But when the post is supposed to return some download headers it doesn't open up a download dialog. It will just show the file binary in my browser. Here is a sample of my code:
$conn=curl_init('http://'.$url.'');
if (!$conn){
die(sprintf('Error [%d]: %s', curl_error($conn), curl_errno($conn)));
}
curl_setopt($conn, CURLOPT_HEADER, 1);
curl_setopt($conn, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($conn, CURLOPT_POST, 1);
curl_setopt($conn, CURLOPT_POSTFIELDS, $HTTP_POST_VARS);
$header=curl_exec($conn);
if(!$header){
die(sprintf('Error [%d]: %s', curl_errno($conn), curl_error($conn)));
}
Thanks for any help,
Dino