core icon indicating copy to clipboard operation
core copied to clipboard

[WebDAV] File containing "+" sign in its name is causing issues when being accessed

Open jcastro-dotcms opened this issue 8 years ago • 5 comments

Reproducible in dotCMS 3.5.1. Reproducible in latest master. Reported by customer: https://dotcms.zendesk.com/agent/tickets/95248

The "+" sign is a valid character for file names. If you have a file named test+file.pdf and upload it to dotCMS via WebDAV, the file cannot be accessed correctly as it needs the "+" sign to be changed by its encoded value. For example, this URL works:

http://localhost:8080/products/test%2Bfile.pdf

However, this one doesn't:

http://localhost:8080/products/test+Bfile.pdf

If the same file is uploaded through the back-end, everything works correctly.

Expected Behavior

Uploading files whose name contains "+" signs to dotCMS from either the back-end of WebDAV should work the same.

Current Behavior

Doing it through WebDAV is not working as expected.

Possible Solution

N/A

Known Workarounds

Upload the file through the back-end.

Steps to Reproduce (for bugs)

  1. Start up dotCMS and connect to it using either the Finder or Cyberduck (for recent versions: http://localhost:8080/webdav/live/1 and for older versions: http://localhost:8080/webdav/autopub)
  2. Upload a file which contains at least one "+" sign in its name: test+file.pdf
  3. Attempt to access the file from the front-end. It will send you to the 404 page.
  4. You will need to replace the "+" sign in the file name with its encodede value: test%2Bfile.pdf

Context

Several customers use WebDAV to upload a large number of files. Asking them to delete and re-upload the files through the back-end is not feasible.

Your Environment

  • dotCMS version used: dotCMS 3.5.1, 5.0.0
  • Browser Name and version: Not relevant.
  • Operating System and version: Not relevant.
  • Application Server and version: Not relevant.
  • Java Brand and version: Not relevant.
  • Database and version: Not relevant.
  • Application module: WebDAV

jcastro-dotcms avatar Feb 09 '18 17:02 jcastro-dotcms

Note to QA: please also test if this also fixed https://github.com/dotCMS/core/issues/12459

dsilvam avatar Feb 15 '18 19:02 dsilvam

Still needs some work because using either Cyberduck or Finder, the file containing "+" does get uploaded, however we're getting a NPE in the logs: https://gist.github.com/shaydotcms/e18efbc2d4c5d742929ebfcb18b7819c

#12459 passed QA

shaydotcms avatar Feb 16 '18 23:02 shaydotcms

Passed QA in release 4.3.0. Was able to upload files with "+" sign using Webdav Tested on release-4.3.0 branch Mac OS 10.10 / Postgres 9.6.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8.6

shaydotcms avatar Feb 26 '18 15:02 shaydotcms

Waiting for #13716 in master branch

shaydotcms avatar Feb 26 '18 15:02 shaydotcms

Passed QA. Files containing "+" sign are successfully uploaded using Finder, however errors in logs are showing even though the files are successfully uploaded. Created issue https://github.com/dotCMS/core/issues/13842

Tested on master branch Mac OS 10.10 / Postgres 9.6.6 / Chrome v64.0.3282.167 / Tomcat 8 / Java 8.6

shaydotcms avatar Mar 12 '18 15:03 shaydotcms