I recently noticed that the image viewer does not work when external users (without a nextcloud account) view a publicly shared folder unless the gallery app is installed and enabled. Clicking on an image in the folder only prompts to download the file. I've included browser logs below. There are no relevant logs for any of the containers, only the request URL as seen in the browser logs.
The viewer works as expected if I am logged into my nextcloud instance, images open as they should.
I noticed that the links are different if I'm logged in vs if i'm viewing the link un-authenicated:
authenticated:
https://my.nextcloud.server.local/remote.php/webdav/Pictures/2019%20My%20Pictures/0A0E5842-CFF5-4FCC-BE66-CB6E4FFA037C.jpeg
un-authenticated:
https://my.nextcloud.server.local/s/4jWdPqHYoGLwQ9N/download?path=%2F&files=0A0E5842-CFF5-4FCC-BE66-CB6E4FFA037C.jpeg
If I enable the gallery app external users can view images just fine. I don't particularly like the gallery app however and much prefer the built-in viewer so I had disabled it. Is this expected behavior and is there something I can do to get a viewer working for people I share links with without a dependency on the gallery app? Any help would be appreciated.
Thanks in advance
The image should open in the now built-in image viewer
You are prompted to download the file
Operating system:
Ubuntu 18.04.3 LTS
Web server:
Nginx (docker)
Database:
Postgres 10 (docker)
PHP version:
php-fpm (from nextcloud:fpm which should be latest compatible version)
Nextcloud version: (see Nextcloud admin page)
Nextcloud 16.0.4
Updated from an older Nextcloud/ownCloud or fresh install:
Updated to latest every release since 14
Where did you install Nextcloud from:
nextcloud/docker repo via docker-compose
Signing status:
Signing status
No errors have been found.
List of activated apps:
App list
www-data@770f2bb3d799:~/html$ ./occ app:list
Enabled:
- accessibility: 1.2.0
- activity: 2.9.1
- calendar: 1.7.0
- cloud_federation_api: 0.2.0
- comments: 1.6.0
- contacts: 3.1.3
- dav: 1.9.2
- federatedfilesharing: 1.6.0
- federation: 1.6.0
- files: 1.11.0
- files_external: 1.7.0
- files_markdown: 2.0.6
- files_pdfviewer: 1.5.0
- files_rightclick: 0.15.1
- files_sharing: 1.8.0
- files_texteditor: 2.8.0
- files_trashbin: 1.6.0
- files_versions: 1.9.0
- files_videoplayer: 1.5.0
- firstrunwizard: 2.5.0
- gpxedit: 0.0.11
- gpxmotion: 0.0.9
- gpxpod: 4.0.5
- logreader: 2.1.0
- lookup_server_connector: 1.4.0
- nextcloud_announcements: 1.5.0
- notes: 3.0.1
- notifications: 2.4.1
- oauth2: 1.4.2
- onlyoffice: 2.4.0
- password_policy: 1.6.0
- previewgenerator: 2.1.0
- privacy: 1.0.0
- provisioning_api: 1.6.0
- recommendations: 0.4.0
- serverinfo: 1.6.0
- sharebymail: 1.6.0
- spreed: 6.0.4
- support: 1.0.0
- survey_client: 1.4.0
- systemtags: 1.6.0
- tasks: 0.11.1
- theming: 1.7.0
- twofactor_backupcodes: 1.5.0
- twofactor_u2f: 3.0.1
- updatenotification: 1.6.0
- viewer: 1.1.0
- workflowengine: 1.6.0
Disabled:
- admin_audit
- encryption
- gallery
- socialsharing_email
- user_external
- user_ldap
Nextcloud configuration:
Config report
www-data@770f2bb3d799:~/html$ ./occ config:list system
{
"system": {
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"nextcloud.wyld.space"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/nextcloud.wyld.space",
"dbtype": "pgsql",
"version": "16.0.4.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtpsecure": "ssl",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"maintenance": false,
"loglevel": 2,
"theme": "",
"app_install_overwrite": [
"spreed"
],
"overwriteprotocol": "https"
}
}
Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No
Browser:
Firefox 68.0.2
Operating system:
Archlinux
Web server error log
Nothing of relevance
Nextcloud log
Nothing of relevance
Browser log
Navigated to https://my.nextcloud.server.local/s/4jWdPqHYoGLwQ9N
The resource from “https://my.nextcloud.server.local/login” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
4jWdPqHYoGLwQ9N
JQMIGRATE: Migrate is installed, version 1.4.1 main.js:278:531
The escapeHTML library is deprecated! It will be removed in nextcloud 19. 2 main.js:750:58
The humanFileSize library is deprecated! It will be removed in nextcloud 19. 2 main.js:750:58
The humanFileSize library is deprecated! It will be removed in nextcloud 19. main.js:750:58
The humanFileSize library is deprecated! It will be removed in nextcloud 19. 2 main.js:750:58
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: https://my.nextcloud.server.local/core/js/dist/main.js?v=f1359c3b-1
Source Map URL: main.js.map
Navigated to https://my.nextcloud.server.local/s/4jWdPqHYoGLwQ9N/download?path=%2F&files=0A0E5842-CFF5-4FCC-BE66-CB6E4FFA037C.jpeg
Most helpful comment
https://github.com/nextcloud/viewer/issues/89