summaryrefslogtreecommitdiff
path: root/download.inc
diff options
context:
space:
mode:
authorPriyanka Bhagwat2014-09-15 18:16:50 +0530
committerPriyanka Bhagwat2014-09-15 18:16:50 +0530
commit3cf1cf388ef88a898852aed1c007f48802061884 (patch)
tree3dad0fcf8b42ec3febd57661a5ae85d68550749b /download.inc
parent7d4c4fc39c5cf59d5e207cd1fb6fa8ca48062223 (diff)
downloadscilab_textbook_companion-3cf1cf388ef88a898852aed1c007f48802061884.tar.gz
scilab_textbook_companion-3cf1cf388ef88a898852aed1c007f48802061884.tar.bz2
scilab_textbook_companion-3cf1cf388ef88a898852aed1c007f48802061884.zip
fixed zip archive name
Diffstat (limited to 'download.inc')
-rwxr-xr-xdownload.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/download.inc b/download.inc
index 8de3d97..3c5102e 100755
--- a/download.inc
+++ b/download.inc
@@ -138,7 +138,7 @@ function textbook_companion_download_book()
/* get example data */
$book_q = db_query("SELECT * FROM {textbook_companion_preference} WHERE id = %d", $book_id);
$book_data = db_fetch_object($book_q);
- $zipname = str_replace(' ','_',strtolower($book_data->book .'.zip'));
+ $zipname = str_replace(' ','_',($book_data->book));
$BK_PATH = $zipname . '/';
/* zip filename */
@@ -180,14 +180,14 @@ function textbook_companion_download_book()
global $user;
if($user->uid){
header('Content-Type: application/zip');
- header('Content-disposition: attachment; filename="' . $book_data->book . '.zip"');
+ header('Content-disposition: attachment; filename="' . str_replace(' ','_',($book_data->book)) . '.zip"');
header('Content-Length: ' . filesize($zip_filename));
ob_clean();
readfile($zip_filename);
unlink($zip_filename);
}else{
header('Content-Type: application/zip');
- header('Content-disposition: attachment; filename="' . $book_data->book . '.zip"');
+ header('Content-disposition: attachment; filename="' . str_replace(' ','_',($book_data->book)) . '.zip"');
header('Content-Length: ' . filesize($zip_filename));
header("Content-Transfer-Encoding: binary");
header('Expires: 0');