Unable to upload files via public upload

Nextcloud version (eg, 12.0.2): 17.0.1
Operating system and version (eg, Ubuntu 17.04): CentOS Linux release 7.7.1908 (Core)
Apache or nginx version (eg, Apache 2.4.25): 2.4.6-90.el7.centos
PHP version (eg, 7.1): 7.2.24

The issue you are facing: I’m getting an error when trying to upload files using a public upload share.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create a share, select file drop.
  2. Open share URL.
  3. Select the Select or drop files button and select a file to upload.
  4. Receive error “Could not upload xxxxx.file”

The output of your Nextcloud log in Admin > Logging:

{"reqId":"XeG4EpqoGIdxar8c6n@DtgAAAAU","level":3,"time":"2019-11-30T00:30:10+00:00","remoteAddr":"75.170.52.152","user":"--","app":"public","method":"PUT","url":"/public.php/webdav/hiker.jpg","message":{"Exception":"Error","Message":"Call to a member function getType() on boolean","Code":0,"Trace":[{"function":"OCA\\DAV\\Connector\\Sabre\\{closure}","class":"OCA\\DAV\\Connector\\Sabre\\ServerFactory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[{"__class__":"Closure"},["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":466,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["beforeMethod",["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php","line":107,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/nextcloud/public.php","line":79,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/ServerFactory.php","Line":147,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0","version":"17.0.1.1","id":"5de1b8388e69c"}

{"reqId":"XeG4EpqoGIdxar8c6n@DtgAAAAU","level":3,"time":"2019-11-30T00:30:10+00:00","remoteAddr":"75.170.52.152","user":"--","app":"core","method":"PUT","url":"/public.php/webdav/hiker.jpg","message":{"Exception":"Error","Message":"Call to a member function getType() on boolean","Code":0,"Trace":[{"function":"OCA\\DAV\\Connector\\Sabre\\{closure}","class":"OCA\\DAV\\Connector\\Sabre\\ServerFactory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[{"__class__":"Closure"},["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":466,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["beforeMethod",["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php","line":107,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/nextcloud/public.php","line":79,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/ServerFactory.php","Line":147,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0","version":"17.0.1.1","id":"5de1b8388e656"}

{"reqId":"XeG4EpqoGIdxar8c6n@DtgAAAAU","level":3,"time":"2019-11-30T00:30:10+00:00","remoteAddr":"75.170.52.152","user":"--","app":"core","method":"PUT","url":"/public.php/webdav/hiker.jpg","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php","line":88,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->","args":[]},{"file":"/var/www/html/nextcloud/lib/private/Template/JSCombiner.php","line":123,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->","args":[]},{"file":"/var/www/html/nextcloud/lib/private/Template/JSCombiner.php","line":100,"function":"isCached","class":"OC\\Template\\JSCombiner","type":"->","args":["merged-template-prepend.js.deps",{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"}]},{"file":"/var/www/html/nextcloud/lib/private/Template/JSResourceLocator.php","line":114,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["/var/www/html/nextcloud","core/js/merged-template-prepend.json","core"]},{"file":"/var/www/html/nextcloud/lib/private/Template/JSResourceLocator.php","line":70,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->","args":["/var/www/html/nextcloud","core/js/merged-template-prepend.json"]},{"file":"/var/www/html/nextcloud/lib/private/Template/ResourceLocator.php","line":78,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->","args":["js/merged-template-prepend"]},{"file":"/var/www/html/nextcloud/lib/private/TemplateLayout.php","line":341,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->","args":[["core/js/dist/main","js/merged-template-prepend","search/js/search","core/l10n/en","core/js/dist/share_backend","search/l10n/en","search/js/searchprovider","js/files/fileinfo","js/files/client"]]},{"file":"/var/www/html/nextcloud/lib/private/TemplateLayout.php","line":169,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::","args":[["core/js/dist/main","js/merged-template-prepend","search/js/search","core/l10n/en","core/js/dist/share_backend","search/l10n/en","search/js/searchprovider","js/files/fileinfo","js/files/client"]]},{"file":"/var/www/html/nextcloud/lib/private/legacy/template.php","line":183,"function":"__construct","class":"OC\\TemplateLayout","type":"->","args":["error",""]},{"file":"/var/www/html/nextcloud/lib/private/Template/Base.php","line":131,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"/var/www/html/nextcloud/lib/private/legacy/template.php","line":332,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"/var/www/html/nextcloud/public.php","line":92,"function":"printExceptionErrorPage","class":"OC_Template","type":"::","args":[{"__class__":"Error"},500]}],"File":"/var/www/html/nextcloud/lib/private/Files/Node/File.php","Line":54,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0","version":"17.0.1.1","id":"5de1b8388e5f2"}

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

<?php
$CONFIG = array (
  'passwordsalt' => 'xxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'xxxxx',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'overwrite.cli.url' => 'xxxxx',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxx',
  'installed' => true,
  'instanceid' => 'ocpag61bdhik',
  'maintenance' => false,
  'mail_smtpmode' => 'sendmail',
  'mail_smtphost' => 'xxxxx',
  'mail_smtpport' => '587',
  'mail_from_address' => 'nextcloud-server',
  'mail_domain' => 'calvertk9search.org',
  'mail_smtpdebug' => true,
  'mail_smtpsecure' => 'ssl',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'theme' => '',
  'loglevel' => 2,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'mail_sendmailmode' => 'pipe',
  'version' => '17.0.1.1',
);

The output of your Apache/nginx/system log in /var/log/____:

[Sat Nov 30 00:09:27.468751 2019] [authz_core:error] [pid 15480] [client x.x.x.x:50982] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Nov 30 00:12:10.991446 2019] [authz_core:error] [pid 16032] [client x.x.x.x:51110] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Nov 30 00:24:20.312200 2019] [authz_core:error] [pid 17030] [client x.x.x.x:51734] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata

@Sparks - I know you posted this a while back, but I see no response from anyone. Did you ever get it resolve? I just ran into the same problem on v18.0.7. I did notice, however, that the issue isn’t present if you set the share link options to “Allow upload and editing”.

Open own thread with own logs. Thanks.