improved the patch Marc commited about headers send to enforce download of dump files
This commit is contained in:
@@ -13,6 +13,7 @@ $Source$
|
||||
* lang/galician.inc.php3: updated thanks to
|
||||
Xos<6F> Calvo <xosecalvo at terra.es>.
|
||||
* lib.inc.php3: fixed a bug with the browse table headers sorting feature.
|
||||
* tbl_dump.php3: improved the patch Marc commited.
|
||||
|
||||
2001-09-05 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* lib.inc.php3:
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Formats the INSERT statements depending on the target (screen/file) of the
|
||||
* sql dump
|
||||
@@ -114,13 +115,18 @@ else {
|
||||
$mime_type = 'text/x-csv';
|
||||
} else {
|
||||
$ext = 'sql';
|
||||
$mime_type = 'application/octetstream';
|
||||
// loic1: 'application/octet-stream' is the registered IANA type but
|
||||
// MSIE and Opera seems to prefer 'application/octetstream'
|
||||
$mime_type = (USR_BROWSER_AGENT == 'IE' || USR_BROWSER_AGENT == 'OPERA')
|
||||
? 'application/octetstream'
|
||||
: 'application/octet-stream';
|
||||
}
|
||||
|
||||
// Send headers
|
||||
// we need "inline" instead of "attachment" for IE 5.5
|
||||
header('Content-Type: ' . $mime_type);
|
||||
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
|
||||
// lem9: we need "inline" instead of "attachment" for IE 5.5
|
||||
$content_disp = (USR_BROWSER_AGENT == 'IE') ? 'inline' : 'attachment';
|
||||
header('Content-Disposition: ' . $content_disp . '; filename="' . $filename . '.' . $ext . '"');
|
||||
header('Pragma: no-cache');
|
||||
header('Expires: 0');
|
||||
} // end download
|
||||
|
Reference in New Issue
Block a user