Skip to content

Commit

Permalink
Item14497: show txt files inline by default
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 25, 2017
1 parent 8d5e4d7 commit 636e421
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion data/System/XSendFileContrib.txt
Expand Up @@ -114,6 +114,7 @@ See https://tn123.org/mod_xsendfile/ for more information on how to compile =mod

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 25 Sep 2017 | remove txt files from default dispositioning |
| 30 Nov 2016 | fixed encoding under Foswiki-2.x; \
detect 404 file not found properly; \
added support for rev parameter to access previous versions of an attachment; \
Expand All @@ -131,7 +132,7 @@ See https://tn123.org/mod_xsendfile/ for more information on how to compile =mod

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="2013-2016, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Copyright" title="Copyright" value="2013-2017, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
Expand Down
10 changes: 5 additions & 5 deletions lib/Foswiki/Contrib/XSendFileContrib.pm
@@ -1,6 +1,6 @@
# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
# Module of Foswiki - The Free and Open Source Wiki, https://foswiki.org/
#
# Copyright (C) 2013-2016 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2017 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -25,8 +25,8 @@ use Foswiki::Time ();
use File::MMagic ();
use File::Spec ();

our $VERSION = '5.00';
our $RELEASE = '30 Nov 2016';
our $VERSION = '5.01';
our $RELEASE = '25 Sep 2017';
our $SHORTDESCRIPTION = 'A viewfile replacement to send static files efficiently';
our $mimeTypeInfo;
our $mmagic;
Expand Down Expand Up @@ -214,7 +214,7 @@ sub xsendfile {
unless (defined $dispositionMode) {
# SMELL: Force office documents into a save-as-dialog using "attachment".
# this is mostly needed for Internet Explorers as other browser do just fine with those type of files in "inline" mode...
$dispositionMode = ($fileName =~ /(?:(?:(?:xlt|xls|csv|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp|rtf|txt|vsd)$/)?"attachment":"inline";
$dispositionMode = ($fileName =~ /(?:(?:(?:xlt|xls|csv|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp|rtf|vsd)$/)?"attachment":"inline";
}

$fileLocation = $location . $pathPrefix . '/' . $web . '/' . $topic . '/' . $fileName unless defined $fileLocation;
Expand Down
1 change: 1 addition & 0 deletions lib/Foswiki/Contrib/XSendFileContrib/MANIFEST
@@ -1,3 +1,4 @@
!noci
bin/xsendfile 0755
data/System/XSendFileContrib.txt 0644
lib/Foswiki/Contrib/XSendFileContrib/Config.spec 0644
Expand Down
2 changes: 1 addition & 1 deletion tools/virtualhosts-xsendfile
Expand Up @@ -45,7 +45,7 @@ sub doit {
}

__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Foswiki - The Free and Open Source Wiki, https://foswiki.org/
Copyright (C) 2008-2015 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
Expand Down

0 comments on commit 636e421

Please sign in to comment.