Server: Upload to public share not possible

Created on 2 May 2019  Â·  7Comments  Â·  Source: nextcloud/server

Steps to reproduce

  1. Create a public share for a folder (allow upload and editing)
  2. Open share
  3. Try to upload any file

Expected behaviour

File should upload

Actual behaviour

Nothing

Server configuration

I used https://demo.nextcloud.com to verify this bug.

Client configuration

Browser: Firefox 66

Operating system: Ubuntu 19.04

Logs

Browser log

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). KpKyxBaCKSSgT9k:1:1
The resource from “https://demo.nextcloud.com/oogozoo9/apps/files/” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).[Learn More] KpKyxBaCKSSgT9k
JQMIGRATE: Migrate is installed, version 1.4.1 main.js:278:521
The escapeHTML library is deprecated! It will be removed in nextcloud 19. main.js:750:50
TypeError: OCA.Files.Semaphore is not a constructor[Learn More] file-upload.js:564:19
    NextJS 5
    _onAdd jQuery
    each NextJS
    _onAdd jQuery
    i/e.widget/</a[t]</< NextJS
    _onChange jQuery
    NextJS 3
    _onChange jQuery
    NextJS 4
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: https://demo.nextcloud.com/oogozoo9/core/js/dist/main.js?v=b9f765af-0
Source Map URL: main.js.map[Learn More]
0. Needs triage bug

All 7 comments

cc @nextcloud/server-triage @tomasz-grobelny

@kesselb Same here... the error is different though.

TypeError: OCA.Files.Semaphore is not a constructor[Weitere Informationen] file-upload.js:564:19
    submitUploads https://url.de/apps/files/js/file-upload.js?v=8a1afb51-47:564
    onNoConflicts https://url.de/apps/files/js/file-upload.js?v=8a1afb51-47:992
    checkExistingFiles https://url.de/apps/files/js/file-upload.js?v=8a1afb51-47:777
    add https://url.de/apps/files/js/file-upload.js?v=8a1afb51-47:1010
    _trigger https://url.de/core/js/dist/main.js?v=8a1afb51-47:290
    _onAdd jQuery
    each https://url.de/core/js/dist/main.js?v=8a1afb51-47:28
    _onAdd jQuery
    i/e.widget/</a[t]</< https://url.de/core/js/dist/main.js?v=8a1afb51-47:290
    _onChange jQuery
    u https://url.de/core/js/dist/main.js?v=8a1afb51-47:39
    add https://url.de/core/js/dist/main.js?v=8a1afb51-47:39
    always https://url.de/core/js/dist/main.js?v=8a1afb51-47:39
    _onChange jQuery
    i/e.widget/</a[t]</< https://url.de/core/js/dist/main.js?v=8a1afb51-47:290
    a https://url.de/core/js/dist/main.js?v=8a1afb51-47:290
    dispatch https://url.de/core/js/dist/main.js?v=8a1afb51-47:39
    handle https://url.de/core/js/dist/main.js?v=8a1afb51-47:39

same Error as @enaut on my instance.

I think this is a duplicate of #14986

Also the fix mentioned in https://github.com/nextcloud/server/issues/14986#issuecomment-484451455 works for me.

just open the file: apps/files_sharing/lib/Controller/ShareController.php and add the following line right before line 415.
\OCP\Util::addScript('files', 'merged-index');

Indeed :)

Uncaught TypeError: OCA.Files.Semaphore is not a constructor
at OC.Uploader.submitUploads (https://amanoo.nl/apps/files/js/file-upload.js?v=1878b538-0:564:19)
at Object.onNoConflicts (https://amanoo.nl/apps/files/js/file-upload.js?v=1878b538-0:992:14)
at OC.Uploader.checkExistingFiles (https://amanoo.nl/apps/files/js/file-upload.js?v=1878b538-0:777:13)
at HTMLInputElement.add (https://amanoo.nl/apps/files/js/file-upload.js?v=1878b538-0:1010:12)
at e.(anonymous function).(anonymous function)._trigger (https://amanoo.nl/core/js/dist/main.js?v=1878b538-0:290:7490)
at File. (https://amanoo.nl/apps/files/js/jquery.fileupload.js?v=1878b538-0:1040:31)
at Function.each (https://amanoo.nl/core/js/dist/main.js?v=1878b538-0:28:2825)
at e.(anonymous function).(anonymous function)._onAdd (https://amanoo.nl/apps/files/js/jquery.fileupload.js?v=1878b538-0:1033:15)
at e.(anonymous function).(anonymous function)._onAdd (https://amanoo.nl/core/js/dist/main.js?v=1878b538-0:290:920)
at Object. (https://amanoo.nl/apps/files/js/jquery.fileupload.js?v=1878b538-0:1238:26)
submitUploads @ file-upload.js?v=1878b538-0:564
onNoConflicts @ file-upload.js?v=1878b538-0:992
checkExistingFiles @ file-upload.js?v=1878b538-0:777
add @ file-upload.js?v=1878b538-0:1010
_trigger @ main.js?v=1878b538-0:290
(anonymous) @ jquery.fileupload.js?v=1878b538-0:1040
each @ main.js?v=1878b538-0:28
_onAdd @ jquery.fileupload.js?v=1878b538-0:1033
(anonymous) @ main.js?v=1878b538-0:290
(anonymous) @ jquery.fileupload.js?v=1878b538-0:1238
u @ main.js?v=1878b538-0:39
add @ main.js?v=1878b538-0:39
always @ main.js?v=1878b538-0:39
_onChange @ jquery.fileupload.js?v=1878b538-0:1228
(anonymous) @ main.js?v=1878b538-0:290
a @ main.js?v=1878b538-0:290
dispatch @ main.js?v=1878b538-0:39
_.handle @ main.js?v=1878b538-0:39

Uncaught TypeError: OCA.Files.Semaphore is not a constructor

Fixed in 16.0.1 via #15432

Was this page helpful?
0 / 5 - 0 ratings