Cannot upload files, error "expected filesize 5160954 got 8192" appears


it is pointet to the correct path. I commented out anyway and look what will happen.

Thanks malbreitenbach,
I was struggling with the same issue for days. I have upgraded to RPi4B from the 3B+ version and I was no longer able to upload.
Your post made it.
Great and clear step by step explanation

1 Like

fantastic. thanks. I added the path (along to the above changes suggested from @malbreitenbach and I solved all my problems.

1 Like

Many thanks to @malbreitenbach and @OliverV
you saved my day !

1 Like

Thank you very much. Applied the changes to config.php as described, created the /var/www/nextcloud/data/tmp’ directory and upload works flawless.
Changed back to the intented tmp directory (btr0 in my setup) and it’s still working.

My version is So this still exists. But at least I have a workaround now. Big thanks, again!

I also had this issue after moving my datadir and fixed it by restarting the php service:

systemctl status php7.3-fpm.service

No tinkering with the config files was necessary.

Sorry for my stupid questions! I’m new to this things!


  • How do I prove if the folder exists?
  • How do I create the folder?
  • How do I give the folder the correct rights?

Can you give me a short step by step manual?

I’m about desperating with this problem!


Please open an own thread with your problem.
Post all about your system, nextcloud version, logs …

How do I prove if the folder exists?
ls -l /path/to/dir

How do I create the folder?
mkdir /path/to/dir

How do I give the folder the correct rights?
chown www-data:www-data /path/to/dir

Hi, thanx for the help!
Now everything works fine.

Should I allthough open a new thread?

Hey thanks for the tip. I was getting frustrated with this error on setting up a new NCP instance, and it fixed once I read your post and restarted the system.