Skip to content

Can't open PDF when filename or folder name contains a space or special character (' ', é, ...) #381

@maxrekorder

Description

@maxrekorder

🩹 Temporary fix (will be shipped in the next Nextcloud minor release only)

ℹ️ This is a temporary fix you can apply manually, from PR #384. To do this:

1) Replace the file at apps/files_pdfviewer/js/files_pdfviewer-main.js on your instance with this file from that PR

2) Clear your (each user must do it) browser's cache and try to open pdfs. This is a must-do, otherwise, the old file will be loaded from browser's cache !!


Steps to reproduce

  1. Create a New Folder
  2. Add a PDF file to to the folder. PDF filename containing a space (e.g. name it "Juergen Klopp.pdf").
  3. Open PDF file "Juergen Klopp.pdf"
  4. It also won't work if the folder contains a space

Expected behaviour

Open the PDF with PDF viewer

Actual behaviour

PDF.js Version 2.5.207 (build: 0974d6052)
Nachricht: Missing PDF "https://domain.org/remote.php/dav/files/user/New/Juergen%2520Klopp.pdf".

Server configuration detail

Operating system: Linux 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64

Webserver: Apache/2.4.41 (Ubuntu) (apache2handler)

Database: mysql 8.0.25

PHP version:

8.0.5
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 21.0.2 RC1 - 21.0.2.0

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.7.0
 - apporder: 0.12.0
 - calendar: 2.2.1
 - circles: 0.21.2
 - cloud_federation_api: 1.4.0
 - comments: 1.11.0
 - contacts: 3.5.1
 - contactsinteraction: 1.2.0
 - dav: 1.17.1
 - documentserver_community: 0.1.9
 - federatedfilesharing: 1.11.0
 - federation: 1.11.0
 - files: 1.16.0
 - files_external: 1.12.0
 - files_pdfviewer: 2.1.0
 - files_rightclick: 1.0.0
 - files_sharing: 1.13.1
 - files_trashbin: 1.11.0
 - files_versions: 1.14.0
 - files_videoplayer: 1.10.0
 - firstrunwizard: 2.10.0
 - forms: 2.2.4
 - issuetemplate: 0.7.0
 - logreader: 2.6.0
 - lookup_server_connector: 1.9.0
 - notes: 4.0.4
 - notifications: 2.9.0
 - oauth2: 1.9.0
 - onlyoffice: 7.0.2
 - passman: 2.3.7
 - password_policy: 1.11.0
 - photos: 1.3.0
 - privacy: 1.5.0
 - provisioning_api: 1.11.0
 - recommendations: 1.0.0
 - serverinfo: 1.11.0
 - settings: 1.3.0
 - sharebymail: 1.11.0
 - support: 1.4.0
 - survey_client: 1.9.0
 - systemtags: 1.11.0
 - tasks: 0.13.6
 - text: 3.2.0
 - theming: 1.12.0
 - theming_customcss: 1.8.0
 - twofactor_backupcodes: 1.10.0
 - updatenotification: 1.11.0
 - user_status: 1.1.1
 - viewer: 1.5.0
 - weather_status: 1.1.0
 - workflowengine: 2.3.0
Disabled:
 - activity
 - admin_audit
 - bruteforcesettings
 - dashboard
 - encryption
 - mail
 - nextcloud_announcements
 - user_ldap
 - workflow_pdf_converter

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "cloud.rekorder.org"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "21.0.2.0",
    "overwrite.cli.url": "http:\/\/cloud.rekorder.org",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "updater.release.channel": "stable",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "maintenance": false,
    "data-fingerprint": "11bd4c43db46260d550ca15af9437513",
    "mail_smtpmode": "smtp",
    "mail_smtpsecure": "ssl",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "theme": "",
    "loglevel": 2,
    "app_install_overwrite": [
        "issuetemplate"
    ]
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions