Big filenames / and big folder paths

Steps to reproduce

  1. upload file with big filename
  2. upload folder with big filename

Expected behaviour

expected to be uploaded

Actual behaviour

i get a file created Notfound

Server configuration

ubuntu 22 , apache2 , php 7.4

Web server:
apache2

Database:
mariadb 10.6

PHP version:
7.4

ownCloud version: (see ownCloud admin page)
10.13.2.3

Updated from an older ownCloud or fresh install:
fresh
Where did you install ownCloud from:
offical repo
Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

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

Are you using encryption: yes/no

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

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

{“reqId”:“oHsprYj1rCDMIaFWQgnZ”,“level”:4,“time”:“2023-11-15T20:38:32+00:00”,“remoteAddr”:“x.x.x.x”,“user”:“username”,“app”:“webdav”,“method”:“PUT”,“url”:“/remote.php/dav/files/username/Kreis%20Paderborn/2019/lfd.%20Nummer/13-2019%20Rahmenkonzept%20Weserlandschaft/Vergabedokumentation%20Weserlandschaft.pdf”,“message”:“Exception: HTTP/1.1 400 expected filesize 791729 got 163840: {"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"expected filesize 791729 got 163840","Code":0,"Trace":"#0 \/var\/www\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(172): OCA\\DAV\\Connector\\Sabre\\File->put()\n#1 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(1098): OCA\\DAV\\Connector\\Sabre\\Directory->createFile()\n#2 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/CorePlugin.php(504): Sabre\\DAV\\Server->createFile()\n#3 \/var\/www\/owncloud\/lib\/composer\/sabre\/event\/lib\/WildcardEmitterTrait.php(89): Sabre\\DAV\\CorePlugin->httpPut()\n#4 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(472): Sabre\\DAV\\Server->emit()\n#5 \/var\/www\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(253): Sabre\\DAV\\Server->invokeMethod()\n#6 \/var\/www\/owncloud\/apps\/dav\/lib\/Server.php(348): Sabre\\DAV\\Server->start()\n#7 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v2\/remote.php(31): OCA\\DAV\\Server->exec()\n#8 \/var\/www\/owncloud\/remote.php(165): require_once(‘\/var\/www\/ownclo…’)\n#9 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php","Line":231}”}

image

Filenames are limited to 250 chars / bytes, probably less if ownCloud adds something internally, and 4000 chars / bytes for the whole stored path.
The difference between chars and bytes I think it depends on the DB used. To be on the safe side, I’d recommend a maximum of 200 ascii chars for the filename.

In any case, the error in the logs shows that not the whole file has been uploaded. Check that you have enough free space in the server and in the temporary folder. In addition, you can try to upload the same file with a shorter name.

1 Like

is there any way to increase the 250 chars limitation ?

It isn’t possible. The limitation is in the DB. Increasing the column length (which you mustn’t do) would just move the goal post without solving the problem.

1 Like

Hey,

for this error:

i have also found an existing FAQ entry from an anonymous user here:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.