Update of /cvsroot/openfirst/projects
In directory sc8-pr-cvs1:/tmp/cvs-serv673/projects
Added Files:
getfile.php
Log Message:
Download support.
--- NEW FILE: getfile.php ---
<?php
/*
* openFIRST.projects - getfile.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Greg Inozemtsev <gr...@si...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
include("../config/globals.php");
if(isset($_GET["id"])){
$id=$_GET["id"];
}
else{
die("File not found");
}
$query=ofirst_dbquery("SELECT AttachedFile,mime FROM ofirst_projects_notes WHERE ID='".$id."';");
if (ofirst_dbnum_rows($query)==0){
die("File not found");
}
else {
$file = ofirst_dbfetch_object($query);
header("Content-type: ".$file->mime);
echo(base64_decode($file->AttachedFile));
}
?>
|