Store file in 2 storage backend

Hi everyone. I’m beginner
Current i have 1 site used Nextcloud 18, i used Amazon S3 for storage backend. But because the distance ( must access to S3 over internet ) and network bandwitch is not good, that cause file processing is very long when user upload big file. User can not access data ( upload status stuck in “processing file” to long.) until my backend ( nextcloud ) upload file succcess to Amzon S3 bnucket.
Now i found a solution that will save user’s file in server filesystem to decrease time processing file and download file , also in that time user’s data will upload to Amazon S3 in background. When file upload to S3 sucesss user can download file normaly.

Has anyone ever tried this this please tell me how can make it ( flow or update code ) or have a better solution please break the suggestion to me ?

Tks everyone.