Very weird behavior when uploading files bigger than 1MB

Nextcloud version: 21.0.2
Operating system: Ubuntu 18.04
Apache version: 2.4.29
PHP version: 7.4

Hi, I am having a very weird behaviour when I upload my files to my own Nextcloud instance (drag&dropping them to a folder, using the web interface).

I first noticed that something weird was happening when I uploaded some photos (>1MB) downloaded from my old Owncloud server. All the photos where corrupted (half of the photo was OK, the other half was grey). At first I thought that the photos had been corrupted when I downloaded them from Owncloud (although I could see them perfectly on Ubuntu). So I opened and saved them again with Gimp, and re-uploaded them to Nextcloud. And it worked! Or so I thought, because now all the photos where ok.

But later, I had the same issue with some audio files. Songs where cut from the middle. I could listen to them completely in Ubuntu, but after uploaded to Nextcloud, they were cut. Then, I realized that all the songs had the same size: 1023KB (there were some of 1024KB, but all ~ 1MB).

There were no errors in the logs, and I tried all the solutions I found online, to ensure that file size was not limited by PHP or Apache. But I couldn’t upload files bigger than 1MB.

Then, I realized that the photos I had uploaded before, that seemed to be OK, had all the same size too: 1023KB. So I downloaded a photo from Nextcloud (that originally had >2MB), and the downloaded photo had 1MB, but it looked exactly as the original file with >2MB.

And now I don’t know if Nextcloud shrinks my photos, or what it is happening. And as I said, logs aren’t helping.

Please can anybody help me? Where can I look to find out what is happening?

Let me know if you need any more info, or you need me to make any test.

Thank you very much in advance,

Is it the same problem, if you use webdav client (e.g. winscp) and/or the desktop client?

What are the upload limits in PHP? When you update php versions in ubuntu, you start with a fresh configuration, so you have to redo all the modifications and perhaps you have to check if all required modules are installed.

1 Like

I hadn’t used WebDAV. I’ve tried and it works without problems. At least I have a workaround to upload my files :slight_smile:

Another weird thing… I have problems from the web interface uploading JPG pictures and MP3 audio files (from different sources, that I have heard for years in different players), but it works uploading FLAC audio files (~30MB), both from WebDAV and via the web interface.
WebDAV works for all those files.

I guess PHP upload limits are set with “upload_max_filesize”, right? It is set to 512M (also, “max_file_uploads” is set to 20, I put it here just in case).

I haven’t updated PHP since I installed Nextcloud, so if there is an incorrect configuration, it is there from the beginning.
I’ve checked that all required PHP modules are installed (following Installation on Linux — Nextcloud latest Administration Manual latest documentation)

Thank you very much for your time! At least I can use WebDAV for now. If you need more information or tests I can do to find out how to solve the problem, please do tell me.

I have the same problem with photos, images, gif and pdf files.
NextCloud 20 all revisions.

Other big files uploading wthout problems.

I also have the same issue and it’s driving me crazy. I have checked all the php.ini. My php is 8.2 and Im using Nextcloud 27.1.2 in Ubuntu