Upload file - API


I have been struggling with the problem of uploading files for a long time.
My goal is to automate the sending of a specified file by a user to another user’s account via external application.
I would’t like to use the sharing mechanism.

The end user orders the file to be sent in the external application. The application uses the admin account to send the file to the specified account.
I know it can be done with CLI. However, I would like to use the API for this.

Can I ask for advice?
Maybe it is possible to use the impersonate add-on with the API?
For example, the admin account is impersonating the user to whom you want to send the file?

About the APIs: Developing my own Outlook Add-in - #2 by tflidd

However, what you want to do sounds more like you want to add a functionality to Nextcloud. And that would rather be through an app. Perhaps it starts like sharing, you can send a user a file, if the user accepts the file, it is copied into their own storage (without permanent link to your file, and you will perhaps want to delete the file after it was received).

There is an option to transfer ownership of files via occ-command:
So you could transfer files to a folder of an upload user and then transfer the ownership of this folder to the user you want.