Update of /cvsroot/openfirst/downloads
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23216/downloads
Modified Files:
getfile.php
Log Message:
Added a content-disposition header to downloads from database. This will provide the right filename and extension for browsers.
Index: getfile.php
===================================================================
RCS file: /cvsroot/openfirst/downloads/getfile.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** getfile.php 8 Jan 2004 01:19:13 -0000 1.4
--- getfile.php 29 Feb 2004 20:54:28 -0000 1.5
***************
*** 34,38 ****
}
! $query=ofirst_dbquery("SELECT FileData,mime,hits FROM ofirst_downloads WHERE ID='".$id."';");
if (ofirst_dbnum_rows($query)==0){
--- 34,38 ----
}
! $query=ofirst_dbquery("SELECT Title,ext,FileData,mime,hits FROM ofirst_downloads WHERE ID='".$id."';");
if (ofirst_dbnum_rows($query)==0){
***************
*** 47,50 ****
--- 47,51 ----
} else{
header("Content-type: ".$file->mime);
+ header('Content-Disposition: attachment, filename="'.$file->Title.'.'.$file->ext.'"');
echo(base64_decode($file->FileData));
}
|