Rest api post files to instance within project

LXD v. 4.11 Rest api:

How do I post files to instances within a project?

In Rest Api docs, described method works for default project:
POST (?path=/path/inside/the/instance)
But targeting a project instance?
I have tried so far:
POST (?path=/path/inside/the/instance&project=MyProj)
POST (?project=Myproj?path=/path/inside/the/instance)
With no success.

POST /1.0/instances/NAME/files?path=PATH&project=PROJECT just tried it here and worked as expected.

Thanks.
I will try again.
Perhaps it matters that either path or file were previously defined as variables:

$endpoint=’/instances/’.$inst_name.’/files?path=’.$path . ‘&project=’ . $project;
$data = ‘@/st1/extend/Center/…/’.$user_id.’/’.$sshkey_name.’.pub’;

curl -s -k --cert ‘.$crt.’ --key ‘.$key.’ -X ‘.$method.’ ‘.$header.’ -d $’’ . $data . ‘’ ’ . $address .$api_endpoint .$endpoint

I made it in shell to keep everything simple.
Still not working.
project=default working, as expected with or without passing it in address line:
curl -k --cert $crt --key $key https://192.168.1.9:7443/1.0/instances/FC-Sql/files?path=/root
curl -k --cert $crt --key $key https://192.168.1.9:7443/1.0/instances/FC-Sql/files?path=/root&project=default
[1] 28349
$ {“type”:“sync”,“status”:“Success”,“status_code”:200,“operation”:"",“error_code”:0,“error”:"",“metadata”:[".bash_profile",".mysql_user",".ash_history",".ssh",".mysql_mydb",".mysql_history"]}

But for project 101:
curl -k --cert $crt --key $key https://192.168.1.9:7443/1.0/instances/X6/files?path=/root&project=101
$ {“error”:“not found”,“error_code”:404,“type”:“error”}

curl -k --cert $crt --key $key https://192.168.1.9:7443/1.0/instances/X6/files?project=101&path=/root
$ {“error”:“missing path argument”,“error_code”:400,“type”:“error”}

This just happens with files. Some other api endpoints works proper with same container in that project.
Perhaps an issue with project name which is numeric?

What Content-Type are you using?

Your shell example is also partly failing because you forgot to put the URL between “” and as it includes a “&”, the shell is executing only part of it and then backgrounding the process.

Very sharp observation!
Yepp!
The “&” was being interpreted by shell.
It has worked now.
Thanks so much!

I had tried it with content-type application octet-stream, text/csv, and all possible x-lxd- variants, all failed.
Indeed it was just about “&” as you hinted already…