Downloading a file without a filename extension doesn't work

I’m trying to use the web interface to download a file named info. However, instead of receiving the file, I receive a file called info.dms, and it’s filled with HTML.

Here’s what the .dms file looks like when opened in a browser:

Is this a misconfiguration on my end? No errors are logged, either into the Nextcloud error console or into the Apache error log.

Extension-free files sync just fine using the Desktop client. Right now I’m trying to access an earlier version of this file, though, so I’d really like to find a solution to this issue.


Details

Nextcloud version: 18.0.3
Operating system and version: Ubuntu 18.04.4
Apache or nginx version: Apache/2.4.29 2020-03-13T12:26:16
PHP version: PHP 7.2.24-0ubuntu0.18.04.3

The issue you are facing: Trying to download files who don’t have extensions in their names just produces junk. I can download versions of other files just fine.

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. Try to download a file without an extension in the name. For example, info.
  2. Receive a file named info.dms, not info.
  3. The file contents consist of an HTML error.

The output of your Nextcloud log in Admin > Logging:

Nothing is logged to the admin console

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocornotornotllp',
  'passwordsalt' => 'RNOTHAPPENING',
  'secret' => 't/CBLABLABLA',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.example.com',
  ),
  'datadirectory' => '/mnt/nextcloud/nextcloud/data',
  'overwrite.cli.url' => 'https://nextcloud.example.com',
  'dbtype' => 'mysql',
  'version' => '18.0.3.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'NAH',
  'dbpassword' => 'NOPE',
  'installed' => true,
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
);

The output of your Apache/nginx/system log in /var/log/apache2/access.log:

99.3.168.205 - bronson [06/Apr/2020:22:30:27 +0000] "GET /remote.php/dav/files/bronson/zelib/info HTTP/1.1" 200 13340 "-" "Mozilla/5.0 (Macintosh) mirall/2.6.4stable (build 20200303) (Nextcloud)"

I’ve verified that renaming the file to have a .txt extension fixes it. Now I can download it using the web frontend.

However, its previous versions are still completely broken. They still contain an HTML error, not the correct text.

I’m surprised that Nextcloud treats files without extensions so poorly!