Problem to acessing files in a folder not created by web interface


I’m running nextcloud 18 on linux Centos 8.

  1. i’ve import a lot of file into my data/user/files folder.
  2. After that i’ve change rights to 705 for directory, and 640 for files as recommended in the nextcloud doc
  3. Then i use occ files:scan to scan the files dir & subdirs

So, when i’m connecting to web interface, i can navigate inside the folder tree, see the files, but not the content (e.g: there is not thumbnail for pictures)!
I can only see the content for files present by deflault (nexcloud_manual.pdf), who have exactly the same access rights as the imported one’s.

The more strange thing is that when:

  1. I create, by the web interface, a folder just under the user root dir (so nextcloud/data/userX/files/HERE)
  2. then i copy with cli (cp), from a “tree-directory”, a file inside
    3 I redo a files:scan with occ

Then i can access to the content of the file (see the picture, open the pdf, etc.) .

So it’s like it’s not possible to get the files from the directory i’ve imported even the rights are exactly the same for a directory i’ve create by web interface.

Fyi i’ve change the location of the standard data directory.

Any idea?
Thanks in advance,


Are the files you copied owned by www-data?

Hi, yes! same owner user:group, same permissions.
The problem is related to selinux. I’ve add the policy fro the new target data folder but it doesnt work, and i cannot remove the preconfigured selinux policy