add site updated
[www/www.git] / newsgroup / attachment.php
1 <?
2 header("Expires: ".gmdate("D, d M Y H:i:s",time()+(3600*24))." GMT");
3 $group=$_REQUEST["group"];
4 $id=$_REQUEST["id"];
5 $attachment=$_REQUEST["attachment"];
6
7 include "config.inc.php";
8 include "auth.inc";
9 require("$file_newsportal");
10 if (!isset($attachment))
11   $attachment=0;
12 $message=message_read($id,$attachment,$group);
13 //print_r($message->header);
14 if (!$message) {
15   header ("HTTP/1.0 404 Not Found");
16   echo "The Attachment doesn't exists";
17 } else {
18   header("Content-Disposition: attachment; filename=".
19         $message->header->content_type_name[$attachment]);
20   header("Content-type: ".$message->header->content_type[$attachment]);
21   message_show("",$id,$attachment,$message);
22 }
23 ?>