Commit 7bdb6f36 authored by Elias Villiger's avatar Elias Villiger
Browse files

#4303 - Download von doc/docx-Dateien

Manual.rst - Doku angepasst
Download.php - Mime type wird nicht mehr an Dateiname angehängt
parent f4da9a0d
......@@ -30,3 +30,4 @@
.virtual_env
/.support_sonar
/.sonar_scanner
/extension/Documentation/html
\ No newline at end of file
......@@ -5032,12 +5032,9 @@ Parameter and (element) sources
* *exportFilename* = <filename for save as> - Name, offered in the 'File save as' browser dialog. Default: 'output.<ext>'.
If there is no `exportFilename` defined and `mode=file`, than the original filename is taken.
If there is no `exportFilename` defined, then the original filename is taken.
If the mime type is different from the `exportFilename` extension, then the mime type extension will be added to
`exportFilename`. This guarantees that a filemanager will open the file with the correct application.
The user typically expect meaningful and distinct filenames for different download links.
The user typically expects meaningful and distinct filenames for different download links.
* *popupMessage*: `a:<text>` - will be displayed in the popup window during download. If the creating/download is fast, the window might disappear quickly.
......
......@@ -151,11 +151,11 @@ class Download {
$rcMimetype = mime_content_type($filename);
// In case there is a wrong filenameextension on the outputFilename: extend it.
$ext = '.' . substr($rcMimetype, strrpos($rcMimetype, '/') + 1); // very very dirty way of getting an extension - only valid for a limited set of mimetypes
$len = strlen($ext);
if (substr($outputFilename, 0 - $len) != $ext) {
$outputFilename .= $ext;
}
// $ext = '.' . substr($rcMimetype, strrpos($rcMimetype, '/') + 1); // very very dirty way of getting an extension - only valid for a limited set of mimetypes
// $len = strlen($ext);
// if (substr($outputFilename, 0 - $len) != $ext) {
// $outputFilename .= $ext;
// }
return $outputFilename;
}
......@@ -252,7 +252,7 @@ class Download {
$localname = 'file-' . $ii;
$ii++;
}
$localname = $this->targetFilenameExtension($filename, $localname, $mimetype);
// $localname = $this->targetFilenameExtension($filename, $localname, $mimetype);
$zip->addFile($filename, $localname);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment