Add a file to nextcloud without using nexcloud

Hi,
I’m a new user to Nextcloud and I have a question, is it posssible to move a file from a folder on my server (Which is not in a Nextcloud folder) and put it in the librabry of one of my nextcloud user ?

Thanks for your answer !
Perzeval

yes.
a) make sure the file belongs to the webserver user (e.g. www-data) after you moved/copied it.
b) run php occ files:scan --<user-name> (or --all)

But where the file should be placed ?
Because when I put it in my user folders it says that there is no occ.

And when I put it in the nextcloud www folder (/var/www/nextcloud/)
It says me that config.php belongs to nextcloud user and that I can’t do the command (exept doing sudo -u nextcloud but it doesn’t work)

Thanks for your help !

occ must be executed like this:

cd /var/www/nextcloud
sudo -u www-data php occ files:scan --all -v

or

sudo -u www-data php /var/www/nextcloud/occ files:scan --all -v

of depenting on the user (www-data) of your webserver and the path to occ.