Cant delete files and folders that was copied to Data folder via terminal

hi community
I need to copy files from external drive to users files directories.
so I added external drive and copied files
cp -R folder_with-data /data/username1/files/
after that started occ fix
like (sudo -u www-data php /var/www/html/occ files:scan --all -v)
now I can see all data but cant delete it via web
what I missed?

You need to adjust the file ownership so that the user, under which the web server is running, is the owner of the files. If e.g. the web server user is “www-data” you need to change the file ownership accordingly by e.g. executing the following command:

chown -R www-data: /data/username1/files

Thanks for your reply
I checked apache2 user acc by runing

ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'

It shows : www-data
after chown -R www-data: /data/myprofile/files
and restarted server
still the same situation((
strange that I dont have an option to delete folder\files as usual right side. only on top (check screne)

  1. copy old data to new user folde
  2. grant priv to data (chown -R www-data: /data/myprofile/files)
  3. scan by occ (sudo -u www-data php /var/www/html/occ files:scan --all -v)
    current order matters
    issue fixed
1 Like