diff options
author | Priyanka Bhagwat | 2014-09-15 18:16:50 +0530 |
---|---|---|
committer | Priyanka Bhagwat | 2014-09-15 18:16:50 +0530 |
commit | 3cf1cf388ef88a898852aed1c007f48802061884 (patch) | |
tree | 3dad0fcf8b42ec3febd57661a5ae85d68550749b /download.inc | |
parent | 7d4c4fc39c5cf59d5e207cd1fb6fa8ca48062223 (diff) | |
download | scilab_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-x | download.inc | 6 |
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'); |