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.

@User126741 Did you end up finding a solution to this problem? I am wanting to implement something similar and have not had good luck implanting anything thus far. Any information as to what you were able to do would be greatly appreciated.

I do not think the occ-command that @tflidd mentioned is an option, given that our script that will be connecting to Nextcloud is an AWS Lambda function.

Hi, would this maybe work for you?

Thanks for the reply. While this is definitely a useful application it will not fit our specific use case. We have external application that the users are uploading to on a public network while the Nextcloud application is hosted in a separate private network. We had requirements to not allow Nextcloud to be reached from the public network, hence the implantation of a separate external application. We are using an AWS S3 bucket as the intermediary for the file storage between the external application and getting them into Nextcloud.