Copy file with rclone on docker

Im currently trying to copy one file from my pc to a diffrent server with rclone running on a docker which im controling with api requests.

I tried to use operation/uploadfile wich dosnt seem to let me specify my file that i want to upload (the documentation says that “each part in the body represents a file to be uploaded” but never explains what that means)

after that i tried operation/copyfile with “scrFs=/ srcRemote=C:/test/test.txt dstFs=remote: dstRemote=/” which gives me the error message “failed: object not found” and with -vv flag only adds “4 go routines active” (using / insrcFs was intentional because in this case i used rClone directly on my laptop")
i tried the same api with diffrent remotes,files,directories and notations but i always get the same resoult

i also tried sync/copy but even though its the first command to work it only copys directories not single files.

Side note: I need to specify the computer im controling rclone with as a remote but that feels like an overcomplicated way that has an easier solution. Something like telling rclone to get the file from the computer im sending the api from. but so far i havent found anything like that. would be nice to know if something like that exists or not.

im controling with api requests.

I'll assume this means you are using the rclone rcd API.

Here's how I'm calling copyfile: rclone-ui/src/pages/Commander.tsx at main · rclone-ui/rclone-ui · GitHub

I've extracted the logic into an rclone-sdk package that I'm using in Rclone UI as well as other apps, it's based on the OpenAPI spec from here: GitHub - rclone-ui/rclone-openapi: OpenAPI 3.1 specification for the Rclone RC API · GitHub

I think the key point is where the file exists. With rcd in Docker, copyfile can only see paths inside the rclone process/container (or remotes configured there), not automatically the PC that sends the API request.

So either bind-mount the host folder into the container and use that container path as srcFs/srcRemote, or send the file as a multipart body to operation/uploadfile from your client.

If sync/copy works only for directories, copying the containing directory with a filter is another workaround, but mounting the source path into the container is usually simpler.