Unable to upload .png/.jpg/.jpeg files to Nextcloud Hub ("Unknown error during upload" & "Target folder does not exist any more")

I have Nextcloud Hub installed on Hostinger. When I try to upload any files with .png/.jpg/.jpeg extensions, these two errors are thrown (but I don’t have the issue when uploading the same files with other extensions).

“Unknown error during upload”
“Target folder does not exist any more”

Nothing appears in the log, even with ‘debug’ => true & ‘loglevel’ => 0.

Nextcloud Hub 9 (30.0.6) PHP version: 8.2.15

  1. The issue persisted after being updated from Nextcloud Hub 29 to Nextcloud Hub 30.
  2. I tried to create config/mimetypemapping.json with mappings for .png/.jpg/.jpeg, the issue persisted.

When trying to open the existing .png files in a mounted external storage, the error “This file no longer exists” appears, and /remote.php/dav/files/.png returns 404 with a single space in a response.

I think the folder does not exists. Post more details. Do you have shell access. Re-scan for updating existing directories and files:

sudo -u www-data php /path/to/nextcloud/occ files:scan --all

If not try to delete folder.

I tried this and maintenance:repair --include-expensive & maintenance:mimetype:update-db --repair-filecache too, and it didn’t fix anything. I have (limited) shell access, and I can execute occ commands.

Which folder should I try to delete? The same error applies even to the root directory of every user, and mounted external storage.

Also, when I open an image viewer with an image with a different extension (.webp / .gif) and select my .png image in it by clicking the next/previous image buttons (arrows), it opens there, but none of its parameters are shown.

Screen capture

One last thing (for now): when the file is requested on /remote.php/dav/files//background.png through GET, the server returns 200 and the file itself. But when it’s requested through PROPFIND, 404 is thrown.

PUT also throws 404, maybe that’s why I can’t upload those files.

It’s likely something like mod_security in use, which is why we ask about that in the support template. It’s likely blocking a variety of things needed for Nextcloud.

I’ve tried both this (official Hostinger guide on turning it off) and everything from here (StackOverflow thread). Nothing fixed the issue I have here.