Error on upload - BadRequest - Any suggestions?

One of my users is getting only red marked files and files added to the ignor list for some reason. Other users do sync fine. Does anyone know how to fix that?

      "Message":"Expected filesize of 113432 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.",

This seems to happen when uploading images

Okay, searched for an hour and found a solution, but still do not know if its the right way.

I found a post about modify the php.ini “/etc/php/7.3/fpm/php.ini” and comment out the default ‘sys_temp_dir’ with a ; before it. after restarted php and apache2 and it seems to work. Can anyone confirm if its okay to do that?

commenting out the line will set it to the system default /tmp.
It should also work with

sys_temp_dir = /var/www/nextcloud/data/tmp

Or, if that is your case, the location you moved data/tmp folder to.

1 Like

Yes it works now without problems with commenting it out like this in the php.ini (/etc/php/7.3/fpm/php.ini”)

; sys_temp_dir = /media/NextCloudPiData/data/tmp

When i use the path (USB) where the data is located


it does not work.

1 Like

Maybe you can check if the folder exists, www-data should be owner of, and able to write to /media/NextCloudPiData/data/tmp

same as "HEADERS on invalid stream"

All valid :slight_smile:

root@nextcloudpi:/media/NextCloudPiData/data# ls -la
-rw-r----- 1 www-data www-data 556391 Aug 17 21:51 nextcloud.log
-rw-r----- 1 www-data www-data      0 Aug 15 00:49 .ocdata
drwxr-x--- 1 www-data www-data     64 Mär 28 21:31 .opcache
drwxr-x--- 1 www-data www-data      0 Aug 17 22:05 tmp

try changing it to 755

1 Like


; sys_temp_dir = /media/NextCloudPiData/data/tmp

back to

sys_temp_dir = /media/NextCloudPiData/data/tmp

in the


set folder permissions to 755 from


and restarted apache and php

sudo service php7.3-fpm restart
sudo service apache2 restart

Works :slight_smile: Upload seems to work also with that path now! Thanks!


Just dropped by to add that this bug STILL occurs when you change your datadir (in my case, an existing btrfs setup) after re-installing NCP from scratch.

The solution described by Swooty solves the issue.

NCP: v1.46.7
image: NextCloudPi_10-08-21
OS: Debian GNU/Linux 10. 5.4.51-v8+ (aarch64)

I really hope this bug can be fixed eventually… thanks.

I had the same issue and followed these steps, but unfortunately when uploading a file, it still gives me an error and tells me that an “unexpected error has occurred”. Oddly enough though, the file appears after I reload the page. I should note too that prior to realizing the issue with uploading files, I was able to import my contacts & calendar fine.

It turns out that it was because I had the app Duplicate Finder installed and it’s what was causing issues. It wasn’t compatible with the Nextcloud version I had.