Commit f5af15994860acc0033c6c8104c862ff421d3da0
1 parent
612756dd
fix for KTS-1127 *on IE, Windows*
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5952 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
16 additions
and
4 deletions
config/config.ini
| ... | ... | @@ -96,6 +96,11 @@ automaticRefresh = default |
| 96 | 96 | ; use a condensed admin ui |
| 97 | 97 | condensedAdminUI = default |
| 98 | 98 | |
| 99 | +; allow "open" from downloads. Changing this to "true" will prevent (most) | |
| 100 | +; browsers from giving users the "open" option. | |
| 101 | +; fakeMimetype = false | |
| 102 | +fakeMimetype = default | |
| 103 | + | |
| 99 | 104 | [i18n] |
| 100 | 105 | ; Default language for the interface |
| 101 | 106 | defaultLanguage = en | ... | ... |
lib/storage/ondiskhashedstoragemanager.inc.php
| ... | ... | @@ -129,14 +129,21 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { |
| 129 | 129 | return; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - function download($oDocument) { | |
| 132 | + function download($oDocument, $bIsCheckout = false) { | |
| 133 | 133 | //get the path to the document on the server |
| 134 | 134 | $oConfig =& KTConfig::getSingleton(); |
| 135 | 135 | $sPath = sprintf("%s/%s", $oConfig->get('urls/documentRoot'), $this->getPath($oDocument)); |
| 136 | + $mimetype = KTMime::getMimeTypeName($oDocument->getMimeTypeID()); | |
| 137 | + | |
| 138 | + if ($bIsCheckout && $oConfig->get('ui/fakeMimetype' ,false)) { | |
| 139 | + $mimetype = 'application/x-download'; | |
| 140 | + // note this does not work for "image" types in some browsers | |
| 141 | + // go web. | |
| 142 | + } | |
| 143 | + | |
| 136 | 144 | if (file_exists($sPath)) { |
| 137 | 145 | //set the correct headers |
| 138 | - header("Content-Type: " . | |
| 139 | - KTMime::getMimeTypeName($oDocument->getMimeTypeID())); | |
| 146 | + header("Content-Type: " . $mimetype); | |
| 140 | 147 | header("Content-Length: ". $oDocument->getFileSize()); |
| 141 | 148 | header("Content-Disposition: attachment; filename=\"" . $oDocument->getFileName() . "\""); |
| 142 | 149 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); | ... | ... |
plugins/ktcore/KTDocumentActions.php
| ... | ... | @@ -371,7 +371,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | $oStorage =& KTStorageManagerUtil::getSingleton(); |
| 374 | - $oStorage->download($this->oDocument); | |
| 374 | + $oStorage->download($this->oDocument, true); | |
| 375 | 375 | exit(0); |
| 376 | 376 | } |
| 377 | 377 | } | ... | ... |